ng2-tree
ng2-tree copied to clipboard
Need help, 'reloadChildren()' doesn't work.
Hey guys, I've created a tree with children async loaded. But when I try to refresh one's children by using "reloadChildren()", the loading process hasn't been triggered. Here's my code snippets : Target node is formed like this :
{
value: folderName,
id: folderId,
loadChildren: (callback) => {
console.log('Load children for folder: ' + folderName);
this.folderService.getCatalogSubFolder(this.catalogCode, child.folderId)
.subscribe((res: any) => {
if (res.success) {
let folderData = res.data ? res.data : [];
callback(res.data);
}
});
}
The statement I call reloadChildren :
this.folderTree.getControllerByNodeId(folderId).reloadChildren();
I've debugged, the two ids are the same. Is there something I did was wrong ? Need helps, thanks in advance. T _ T
And the 'Controller' I get is correct btw.
Hm... Same problem here, the first time it works but when triggered multiple times it just stops working...
I now have to switch to another tree component (https://github.com/500tech/angular-tree-component), for my async tree, which isn't that flexible for providing css classes on a node level... But where this functionality is used in another tree where no dynamic content is used.
It also seems like the development on this project has stopped :(