Allow passing extra props to Cell via Row component

This issue has been tracked since 2022-08-31.

Use case

When a column header is selected, we want to highlight all cells in the column by applying a different class name. However, currently the class applied to the cell is only calculated when the Cell component renders, and there isn't a good way to force a specific cell to re-render via the Row component.

Proposed solution

Add a method to the Column type to allow additional props to be passed to the Cell. Additional props are already supported in the Cell component and are applied to the wrapper div.

interface Column<TRow, TSummaryRow = unknown> {
  // ...
  readonly cellWrapperProps?: Maybe<Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'children'> | ((row: TRow) => Maybe<Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'children'>>)>;
 // ...
}

This way, to force a re-render we can e.g. pass a prop like data-col-selected="true".

More Details About Repo
Owner Name adazzle
Repo Name react-data-grid
Full Name adazzle/react-data-grid
Language TypeScript
Created Date 2015-03-06
Updated Date 2023-03-23
Star Count 5922
Watcher Count 129
Fork Count 2072
Issue Count 161

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date