ng2-tree icon indicating copy to clipboard operation
ng2-tree copied to clipboard

Need help, 'reloadChildren()' doesn't work.

Open colinsanity opened this issue 6 years ago • 2 comments
trafficstars

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

colinsanity avatar Dec 27 '18 10:12 colinsanity

And the 'Controller' I get is correct btw.

colinsanity avatar Dec 27 '18 10:12 colinsanity

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 :(

Devp00l avatar Dec 20 '19 11:12 Devp00l