Fancytree nodes removed but UI not updating

161 Views Asked by At

I have a strange issue with FancyTree while doing lazy load the previous items are not getting cleared.

 lazyLoad: function (event, data) {
 data.node.removeChildren();
                    data.result = {
                        url: request_url + "?type=get"
                        };
}

The previous children are still there and new data is appending, however, in node.children method, I don't see them. Looks like the issue is with UI reload but not sure how to fix that.

1

There are 1 best solutions below

0
mar10 On

Lazy nodes should not have children, just the lazy attribute set.

Only when the node is expanded for the first time, the lazyLoad() callback gets called. Therefore there is no need to remove children.