'AG-GRID: Is there a way to have expand/collapse functionality on a row and show custom content in the expanded area?

We need to have the ability to expand/collapse individual rows and when expanded show custom (angular) components in the area below the row, which will receive as input some of the data of the expanded row.

The closest thing we found is the Master/Detail feature of the enterprise version, but we don't want to display a nested table within, we want to have custom content.

similar to this this



Solution 1:[1]

I based my tree grid implementation off of this: https://riddheshganatra.medium.com/tree-data-with-ag-grid-community-94ba1dfb40eb with the associated code repo here: https://github.com/riddheshganatra/ag-grid-tree and some work I did to clarify it for readability (in my mind at least), as well as some optimization (recursive search to lookup-table) and making things into a proper class structure to align more with ag-grid documentation examples.

https://github.com/nmz787/ag-grid-tree

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nmz787