Skip to content

Grid "active" state, separate from "selected" #9969

@baleeds

Description

@baleeds

Is your feature request related to a problem? Please describe.

Our UX requires checkbox multi-select for performing bulk actions but also has the ability to click a single row and open a details panel. The row that is being viewed in the details panel is then "active" and should have a blue background. The selection state is decoupled from the active state.

Describe the solution you'd like

I would like the ability to specify whether a row is "active" or the ability to specify custom classes based on the data in a row. Another option would be to have the row ID as a data attribute on the row DOM element.

I'm sure your team has seen ag-grid. Not saying you should be more like ag-grid, but they do have a feature where the grid options can specify a "getRowClass" callback which provides the row data and returns class names for a row. This feature would work to solve our problem, since we track the "active" state independently from the grid. One common way to track the active state would be the ID of an item in the current route.
https://www.ag-grid.com/javascript-grid/grid-callbacks/#reference-callbacks

Describe alternatives you've considered

The only way I can think to do this with my current understanding is to keep track of the active row primary key, and use the template context on each column template to determine if this column's row's data is active.

Metadata

Metadata

Assignees

Labels

🧰 feature-request✅ status: resolvedApplies to issues that have pending PRs resolving them, or PRs that have already merged.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions