DataGrid - Cell rowspan & colspan

Cell rowspan and colspan

<ReactDataGrid /> cells can be configured to span over multiple rows or columns - via the column.rowspan() and column.colspan() functions, which should return numeric values - the number of columns/rows for the current cell to span over. .
This configuration is done via column.rowspan({ data, value, rowIndex, column, dataSourceArray }) and column.colspan({ data, value, rowIndex, column, dataSourceArray }) column-level prop functions - in those functions you have access to all the info you need to perform dynamic row/col spanning
Please keep in mind that the grid has sorting/filtering/etc, so the same cells are not always siblings, as they can be sorted or filtered out or columns can be hidden or reordered.
Because of this, in the column.rowspan and column.colspan functions you have access to the data you need to make those truly dynamic.
The column.rowspan &column.colspan functions should return a numeric value - the number of columns/rows the current cell should span over.
Top