4

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.

1 Answers1

5

Try

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

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

mar10
  • 14,320
  • 5
  • 39
  • 64
  • for setExpanded, I get error: Fancytree assertion failed: only init supported. Note that I am using parentNode.resetLazy(); before node.load – Jaber Al Nahian Jun 05 '21 at 08:06