<ReactDataGrid />
supports displaying locked rows - which can be used to display custom data at the start or the end of the normal grid rows - via lockedRow.position property.lockedRow.position
property.lockedRow.render
in order to tell the DataGrid
what to render for the cells inside the corresponding locked row.lockedRow.render
can be an object with keys corresponding to columns, while values can be functions or ReactNode
values. Using a function gives you the flexibility to decide what to render at run-time - for example, the first argument will have a summary
property which will hold the value computed via the configured summaryReducer
.summaryReducer
- which are simple objects with the following props:initialValue
- the initial value to be used for the summary computation - generally a number/string/etcreducer(accumulator, currentItem)
- the reducer function - basically computes the summary from the accumulated value (at first call, this will equal the initialValue
) and the current item at which we are doing the computationcomplete(accumulatedValue, array)
- can be used for doing one last computation at the end of the iteration - for example useful for computing the average of a value. The first argument is the accumulated value, while the second is the array on which the summary was computed againstmin
, max
and average
values for the population column.lockedRow.render
functionlocked row cell styling
lockedRows
will have the height as normal grid rows, since useRowHeightForLockedRows
defaults to true
,useRowHeightForLockedRows=false
will make the lockedRows
not limited to the height of grid rows, but they will adjust to the natural height of their content.lockedRow.colspan
- the value used for the colspan
can be an object or a function. In case it's defined as an object, each key should correspond to a column, while the value determines the amount of the colspan. In case it's a function, the first argument has a column
property, which you can use to decide how much colspan you want the footer cell to have.columnIndex
and summary
, while the second argument is the computed grid props.