Data Grid - Row customization recipes
Advanced row customization recipes.
One expanded detail panel at a time
By default, the Master detail feature supports multiple expanded detail panels simultaneously.
However, you can control the expanded detail panels to have only one detail panel expanded at a time.
Order ID
Customer
Placed at
Currency
Total
1
Matheus
3/4/2025
HKD
351.56
2
Olivier
10/15/2024
MXN
218.5
3
Flavien
2/6/2025
MXN
607.79
4
Danail
11/3/2024
AUD
139.29
5
Alexandre
4/12/2024
NZD
627.78
Expand or collapse all detail panels
The following demo shows how to create a custom header element that expands or collapses all detail panels at once.
Here's how it works:
The custom header uses gridRowsLookupSelector
to find all rows with a detail panel.
It checks the status of open panels using the useGridSelector
hook to access the grid's state.
When clicked, it uses setExpandedDetailPanels
from the Grid API to expand or collapse all detail panels.
Order ID
Customer
Placed at
Currency
Total
1
Matheus
10/5/2024
AUD
435.48
2
Olivier
2/3/2025
GBP
880.99
3
Flavien
11/28/2024
HKD
288.01
4
Danail
8/29/2024
GBP
902.84
5
Alexandre
10/9/2024
MXN
696.35