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?
I finally set the SingleBranchExpand to false. This worked well enough. Thank you for all the help!
Hi there,
If you would like all parent nodes to be rendered as expanded then you can use the initialExpandDepth option or the expandedKey in the node bindings.
You can set the initialExpandDepth to the depth of the tree or larger and then all nodes at this depth or lower would render as expanded:
http://help.infragistics.com/jQuery/2014.1/ui.igtree#options:initialExpandDepth
Using the expandedKey in the node bindings populate the json you're databinding the igTree to with boolean values being true for that key:
http://help.infragistics.com/jQuery/2014.1/ui.igtree#options:bindings.expandedKey
data = {Text: "text", Expanded: true}
bindings: { expandedKey: "Expanded" }
If you want to use the API and render the nodes collapsed and expand them upon a certain interaction then use Vasya's suggestion.
Hello Big_Lebowski,
Please let me know if you need any further assistance with this matter.
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.