Implement expand/collapse in Grid with flat data without grouping
Environment
Product Version | 5.12.0 |
Product | Progress® KendoReact |
Description
I have flat data and I want to add expand/collapse functionality for hiding a given set of items by some custom condition.
Solution
Add a column with custom "cell" for rendering the expand/collapse icons. Within the Grid's rowRender the 'child' items visibility can be determined by the custom logic in which the items are 'grouped'.
Following is an example demonstrating how to simulate hierarchy with flat data where the order of the items in the 'data' are in the correct order and the parent items have ParentID equal to 0.