Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 1/14/2005 at 09:07 AM |
|
|
Collaps all - includes root nodes
the function
function collapse_all (n_index, n_depth) {
var o_tree = TREES[n_index ? n_index : 0];
if (!n_depth) n_depth = 1;
if (!o_tree)
alert("Tree is not initialized yet");
var a_nodes = o_tree.a_nodes;
for (var i = a_nodes.length - 1; i >= 0; i--)
if (a_nodes.n_depth >= n_depth && a_nodes.open)
a_nodes.open(1, 1);
o_tree.ndom_refresh();
}
Collapses everything exepted the root nodes. Is it possible to extend this function in order to collapse the whole tree? If yes, how?
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 1/14/2005 at 09:38 AM |
|
|
Omit verifiaction of the nodes' level (n_depth)
|
|
|
Bender
Member
Posts: 19
Registered: 1/11/2005
Member Is Offline
|
| posted on 1/14/2005 at 10:27 AM |
|
|
That was easy ;)
Can I load this function when building the tree for the first time in order to get a totally collapsed tree without clicking on a specific link?
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 1/14/2005 at 01:47 PM |
|
|
sure you can
|
|
|