[EuiDataGrid] Add new gridStyle.rowClasses API#5732
Conversation
- This sets up us shortly adding a `useEffect` to the row manager file
- mostly copying the control columns example for the selection logic
|
Adding @kertal as a reviewer, mostly for feedback on the documentation/developer experience (https://eui.elastic.co/pr_5732/#/tabular-content/data-grid-style-display#grid-row-classes). Hopefully this won't turn out to be more of a hassle to use than |
|
jenkins test this |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5732/ |
chandlerprall
left a comment
There was a problem hiding this comment.
Changes LGTM; pulled & tested locally, including configuring the example to use in-memory sorting & verified the checked rows' & initially-styled row's classnames follow the sort operation.
|
sorry to bring this back up.. but this is not working on v93.1.1, now the rowclasses keep 'pilling up' (even the demo on the datagrid style & display - grid row classes) class="euiDataGridRow euiDataGridRow--rowClassesDemo euiDataGridRow--rowClassesDemoSelected euiDataGridRow--rowClassesDemoSelected" when you remove the selection it is not removing the classes, and adding the new one.. it's just pilling it up.. did something change on how to customize row background/colors? |
|
i'm currently 'reseting' the row className before applying my styles, like so: |
|
@rbarszcz After investigating this bug a bit more, it's actually incredibly specific to the classNames being used. Until #7548 is merged and is released, if you rename your CSS class from |
Summary
closes #4401
This PR adds the ability to add specific classes/styling to certain rows, primarily for the purpose of highlighting (e.g. selections, or important row data, etc.), via a new
gridStyle.rowClassesprop. The API of this is intentionally meant to be similar torowHeightsOptions.rowHeights.Screencaps
Added a gradient/striped example to show how styling differs from styling each individual cell:
Checklist
and playground toggles- [ ] Checked in mobile- [ ] Checked in Chrome, Safari, Edge, and Firefox- [ ] Checked for breaking changes and labeled appropriately- [ ] Checked for accessibility including keyboard-only and screenreader modes- [ ] Updated the Figma library counterpart