Board Logo

Programmatically selecting or opening a node
zombie - 12/2/2004 at 06:12 PM

I know this question was addressed earlier in the forum but I ma not clear.

In my case I have folderids and names for the entire tree structure. Is it possible to to select or open a node without manually clicking on it?

''set the node's id to this folder id so that I can use your code

var o_item = mytree.a_index[folderid];
o_item.open();''

I appreciate your response.


zombie - 12/2/2004 at 07:34 PM

Actually, another point on this same question is I tries your technique where we pass the index 0, 1, 2...etc for the different tree items to select a node programmatically. It works fine as long as the target node's depth is either 0 or 1 . If the node is any depper than 1, it will not select the node, it gives the following error message.

"style is null or not an object."
This error occurs on the line 114.
get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold';


rock - 12/3/2004 at 10:49 AM

To select items in depth>1 you should open its parents before.


tdodds - 2/8/2005 at 01:59 PM

How do we reference the parent?

I've tried o_parent and a few other attemps...

Any help appreciated.


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