Board Logo

Problem with o_item.select() when depth > 1
ukmoths - 1/19/2006 at 11:30 PM

Hi,

I'm having a problem with the o_item.select() method for items where the depth is greater than 1.

I'm using the code from openItemByCaption, with modification to select the found item.

It works fine if the item's n_depth is less than 2, but at depth 2 it returns the error 'Object doesn't support this property or method'.

I've also tried o_tree.select(o_item.n_id) with the same results.

Am I missing something obvious?

Regards,
Ian.


rock - 1/20/2006 at 12:02 PM

Documented openItemByCaption function openes item's parent nodes before select it - so it should not cause the error. If you removed some functionality make sure the item is inited before call it's select method
//for v1.3
var o_state = o_item.state();
alert(o_state.inited);
To init the item you should open all its parents. See API examples.


ukmoths - 1/21/2006 at 09:05 AM

Thanks,

I was selecting the item before the parent node was opened. I moved the select() call after this and now it's just fine!

Regards,
Ian.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/