Hi,
I'm using a igx-tree-grid with the load on demand for sub grids as stated in the demo:
https://ko.infragistics.com/products/ignite-ui-angular/angular/components/treegrid/load_on_demand.html
We have combination of search parameters and button and igx-tree-grid. On click of button, we are loading igx-tree-grid load on demand as a result. On the search, the parent row loads perfectly with arrow expand indicator. On click of arrow indicator, children rows are loaded properly.
Issue: When i click on the button to Get Data, Igx Tree Grid loads with parent row and arrow indicator as result. When i click on arrow indicator, sub-grid data (children rows ) are displayed. when i click on button again, i get parent row as result but the arrow indicator is not displaying. I inspected the arrow element and its visibility is hidden in CSS.
To resolve the issue: I want to re-load /refresh the igx-tree-grid every time i click on button. But couldn't find any such method.
Full Repo Stackbliz: https://stackblitz.com/edit/angular-f572nu-tfucxx?file=src%2Fapp%2Ftree-grid%2Ftree-grid-load-on-demand-sample%2Ftree-grid-load-on-demand-sample.component.ts
Please help me with this.
This is a bug in igx tree grid load on demand. As we are using this feature, we need a quick work around or fix. Reply ASAP.
Hello Shobhana,
I have reproduced the problem you described.This is possibly a bug in the product, so it needs to be investigated as a GitHub issue.
A possible workaround for now is to call collapseAll() method before you assign the data like below.
public GetData() { this.treeGrid.collapseAll(); this.treeGrid.isLoading = true; this.dataService.getData(-1, (children) => { this.data = children; this.treeGrid.isLoading = false; }); }
Hi Mihoko,
This still does not resolve the issue, You can try in the stackbliz sample i have provided.
Scenario: When i click Get data button for first time, and than grid data loads. I click on the collapse button. When i click on the Get Data button again, the collapse button is not visible. Only parent row is visible. As we are using in our on going project, so we need a quick work around ASAP. Also kindly raise a request to fix this bug ASAP.
I have logged this issue in GitHub. Your can check the status from the link below.
https://github.com/IgniteUI/igniteui-angular/issues/7677
I'm not able to reproduce the problem after adding collapseAll().I have recorded my testing, so can you please take a look at the attached video to make sure that I'm following the correct steps?
igxTreeGrid_video.zip
There is an update in the GitHub issue.
It turned out that the current behavior is by design.When the data source is changed, expansionStates should be cleared like below.
this.data = children;this.treeGrid.expansionStates = new Map<any, boolean>();this.treeGrid.isLoading = false;