debabratapatra / angular-tree-grid

Angular 10 Tree Grid
https://curiouslinks.com/pages/angular-tree-grid/demo
MIT License
31 stars 17 forks source link

Problem with expandRow in case of Dynamic Children #42

Open underhill84 opened 4 years ago

underhill84 commented 4 years ago

I'm trying to expand automatically level 0 of my tree. After initial loading, I set data to the tree grid and try to expand the root node with expandRow(root.id). the expandable indicator change to expanded, but child data are not loaded. I've tried the same thing into your demo at that link https://debabratapatra.github.io/pages/angular-tree-grid/demo/#/dynamic_children if you click on expandAll, you will have the same behaviour.

image

Looking at the image, I found that if we are in the root level, pathx have only one element, so the first If inside the for always avoid the following code I've tried on my local .js file to fix this with let expanded_count = 0; , and works, but I'm not sure if can cause other problems.