In the doc regarding Load on Demand for Hierarchical Grid, event onGridCreated is fired when a Row is expanded.
After expansion, the event is no longer triggered, since the grid is already created.
Is there a way to trigger the event every time a row is expanded, or be able to destroy the inner grid when the row collapses?
Doc: https://es.infragistics.com/products/ignite-ui-angular/angular/components/hierarchicalgrid/load-on-demand
Thanks
Hello,
I have been looking into your question and an approach I could suggest is to use the IgxHierarchicalGrid onRowToggle event. It would be emitted when the expanded state of a row gets changed. However, please keep in mind, that initially when the child grid is created, the event is fired before onGridCreated event.
Also, the event should be defined for each row island.
Here could be found my sample for your reference. Please test it on your side and let me know if I may be of any further assistance.
Sincerely,
Teodosia Hristodorova
Associate Software Developer
Hi Teodesia,
I had tried onRowToogle event before onGridCreated, but the first time the row is expanded, the child grid appears empty even tough the data is fetched from remote service and binded to the grid. After collapsing and expanding again, the child grid shows the data.
Thats why after that I tried the onGridCreated approach. But I need the grid to be re populated every time the Row Island is expanded. In the sample you provided, the data is only fetched once.
Is there a way to fullfill my need?