Luca Stefanuto
Luca Stefanuto

Reputation: 95

Fancytree not expand node after reload

I'm working with fancytree.

How can open a node (lazy) after it was reload in javascript?

Code:

node.load(forceReload = true);
node.setExpanded();

When execute node.setExpanded() I get "Assertion failed" error. I think that the problem is executing the setExpanded() instruction before that node.load() is executing.

Thank you.

Upvotes: 4

Views: 5543

Answers (1)

mar10
mar10

Reputation: 14814

Try

node.load(true).done(function(){
  node.setExpanded();
});

See also http://www.wwwendt.de/tech/fancytree/doc/jsdoc/FancytreeNode.html

Upvotes: 5

Related Questions