Master detail is an AG Grid Enterprise feature, so you’ll need a license key to use it. See Using AG Grid Enterprise for an example of how to use your license key with Dash AG Grid components.
To add expandable rows within a grid, you can use master detail.
To use the master detail feature to display nested grids within each row of a top-level master grid, your rowData
object must have a nested structure like the data in this example.
To use master/detail view:
- Enable enterprise mode by setting enableEnterpriseModules=True
.
- Set masterDetail=True
.
- Pass detailCellRendererParams
to set the display options for the detail grid. It must include at least the following keys:
- detailGridOptions
containing columnDefs
for the detail grid
- detailColName
containing the column name in the data where the detail grid data is stored
- Optional: Set height of detail grid
- For fixed height, set detailRowHeight
on dashGridOptions
to a number of pixels
- For auto height to fit all data, set detailRowAutoHeight=True
on dashGridOptions
Aggregate functions can be applied to any column to populate the row group with values. The simplest way to enable aggregations is with the built-in aggregation functions; sum
, min
, max
, count
, avg
, first
, last
. The following snippet shows how these aggregate functions can be applied to columns using aggFunc
:
In this example, new row data is served using a request/response model, similar to infinite scroll.