jqTree
jqTree copied to clipboard
Expand all branches of a selected node.
Hi Mbraak,
Is there any function to open all BRANCHES OF THE SELECTED NODE?
You could do something like this:
// open children of node 'Saurischia'
var node = $tree.tree('getNodeByName', 'Saurischia');
node.children.forEach(function(child) {
if (child.isFolder()) {
$tree.tree('openNode', child);
}
});
Note that this example uses the Array.forEach function, which is not available in ie8.
Sorry mbraak , I executed you suggestion code the result as following: not all branches of selected node will opened. they opened only the parents below the selected node.
You could do the following:
var node = $tree.tree('getNodeByName', 'Saurischia');
node.iterate(function(child) {
if (child.isFolder()) {
$tree.tree('openNode', child);
}
return true;
});
Thank you for help :)