patternfly / patternfly-bootstrap-treeview

Tree View for Twitter Bootstrap -
http://jonmiles.github.io/bootstrap-treeview
Apache License 2.0
200 stars 105 forks source link

ExpandAll with lazyLoad not working #104

Open pszNicx opened 5 years ago

pszNicx commented 5 years ago

Hi,

I'm having an issue when I try to expand my entire tree using expandAll when I have lazy loaded branches. I'm working around this by explicitly expanding each node but it seems the issue is happening here:

bootstrap-treeview.js line 1585:

$.each(nodes, $.proxy(function (index, node) {
            this._setExpanded(node, (level > 0) ? true : false, options);
            if (node.nodes) {
                this._expandLevels(node.nodes, level-1, options);
            }
        }, this));

When lazyLoad is set to true on a node, the node does not show as having any nodes property when it gets to the if statement. This skips the call to expand any such branch.

-- Nick