Hi,
We want to do some manipulations for the specific row (igx-hierarchical-grid:parent grid), when the child grid (igx-rowisland) is expanded. There are properties related to expanded in the infragistics documentation but there is no event for the toggle/expand/collapse in igx-hierarchical-grid.
Please assist with the possible solutions to achieve the functionality.
Thanks,
Ishani
Hello Ishani,
Thank you for posting in our community.What I can suggest for achieving your requirement is working with hierarchicalState property that IgxHierarchicalGridComponent class provides. This is an array consisting of all toggled rows. The state of this collection can be tracked for any changes. When such a change occurs, this means that a row was toggled. This row was either expanded or collapsed, however, in both cases the hierarchicalState array is updated. A working sample illustrating my suggestion can be found here.
https://stackblitz.com/edit/angular-6byo8k
What we have in this sample is an iterable needed to determine changes in the hierarchicalState array. It is created into the constructor of the component and is used at later stage to initialize a differ (See angular.io/.../IterableDiffer for reference). The differ could be used to determine whether the array of toggled rows has changed. Having this, one could easily determine which rows are collapsed, expanded etc.
Please do not hesitate to contact me if you need any further assistance.
Best regards, Petko
Hi Petko,
Thanks for your assistance.
We are making asynchronous calls to get data for the grid. Is there any alternative to use the hierarchical state array in other methods and not in ngDoCheck() ?