Team,
As the subject says, is there a way to expand all nodes? We're putting the tree in a scrolling div so we want the whole thing to be expanded at once.
Any ideas?
Hello Big_Lebowski.
Thank you for posting in our community.
What I can suggest for achieving your requirement is to loop trough nodes and the igTree and use the expand method in order expand them. According to our API, ui-igtree-node is a class applied to every node element in the tree. This is how we are going to reference all nodes to loop them afterwards. For example:
$('#expand-all-nodes-button').on('click', function () { $tree.find('.ui-igtree-node').each(function (index, node) { $tree.igTree('expand', $(node)); }); });
$('#expand-all-nodes-button').on('click', function () {
$tree.find('.ui-igtree-node').each(function (index, node) {
$tree.igTree('expand', $(node));
});
I am attaching a small sample project illustrating my suggestion for your reference. In my application I am expanding all nodes on a button click.
I hope you find this information helpful.
Please let me know if you have any further questions regarding this matter.
Hello Big_Lebowski,
Please let me know if you need any further assistance with this matter.