Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
425
Expand all nodes?
posted

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?

Parents
No Data
Reply
  • 17590
    Verified Answer
    Offline posted

    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));

                });

            });

    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.

    igTreeExpandAllNodes.zip
Children