Gala Support Team
Joined: 21 Jul 2003 Posts: 12
|
Posted: Mon Jul 28, 2003 9:31 pm Post subject: |
|
|
Yes, you can find certain node. You can find specific node object by it's caption, URL, or ID. We have three functions which make it possible:
| Code: | tree1.nodeByName(caption)
tree1.nodeByID(id)
tree1.nodeByURL(url) |
(Instead of "tree1" you should insert variable name that contains reference to your tree.)
All these functions return node object. The most useful thing in it is its "index" field. You can pass this index to functions "expandNode()" and "selectNode()" for the tree will expande and the focus will set on the node which is found, for example:
| Code: | // Initialization code:
var tree1 = new COOLjsTreePRO(...);
...
var node = tree1.nodeByName("Home");
if (node) tree1.expandNode(node.index); |
Also there is field "expanded" - boolean flag which is set to true when
node is expanded and to false otherwise.
Input parameters for these functions - nodeByName, nodeByURL, nodeByID - correspond to several fields in the tree structure from your tree_nodes.js (field 'id' is optional - it can be ommited):
| Code: | | [{'id':56}, 'Caption 1', 'url_1.html', 'target_frame'... |
So, to find this node in the tree you can call functions mentioned above:
| Code: | var node = tree1.nodeByName('Caption 1');
var node = tree1.nodeByID(56);
var node = tree1.nodeByURL('url_1.html'); |
Good luck! |
|