Method 'expandNode' doesn't expand when treetable is not visible
Hi,
I am using jquery-treetable together with JQueryUI tabs. Each tab has its on treetable. After the initialization of the treetables, I call 'expandNode' on a specific node. The treetable that is in the active (and visible) tab expands successfully. However, the other treetables (that are in the hidden tabs) remains collapsed, even though the icon changes to 'expanded'.
For while, I changed this method, commenting the 'if' as shown bellow:
Node.prototype.expand = function() {
if (this.expanded()) {
return this;
}
this.row.removeClass("collapsed").addClass("expanded");
if (this.initialized && this.settings.onNodeExpand != null) {
this.settings.onNodeExpand.apply(this);
}
//if ($(this.row).is(":visible")) { //commented
this._showChildren();
//}
this.expander.attr("title", this.settings.stringCollapse);
return this;
};
Now it works! Why the condition that I commented is necessary?
Thanks!
Hi, If you call table.treetable('expandNode', nodeId); on a node under a collapsed node you will need the condition ($(this.row).is(":visible")). To solve the problem (Method 'expandNode' doesn't expand when treetable is not visible), I replaced the condition ($(this.row).is(':visible')) by ($(this.row).css("display") != "none")