Board Logo

Collaps all - includes root nodes
Bender - 1/14/2005 at 09:07 AM

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 - 1/14/2005 at 09:38 AM

Omit verifiaction of the nodes' level (n_depth)


Bender - 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 - 1/14/2005 at 01:47 PM

sure you can


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