[data grid] Enable indeterminate state for row checkboxes #6177
Labels
component: data grid
This is the name of the generic UI component, not the React module!
feature: Row grouping
Related to the data grid Row grouping feature
feature: Selection
Related to the data grid Selection feature
new feature
New feature or request
plan: Premium
Impact at least one Premium user
Summary 💡
This is somewhat related to this request but not necessarily dependent on it: #4248
We need the ability to select all/deselect all children based on a parent group selection. We've achieved this via our own selection state calculation. What we would also like to do though is show the group checkbox as indeterminate if you've only selected some of the children. it's possible that if you implement a solution for issue 4248, to make it consistent with the select all checkbox behaviour, indeterminate state might be supported out of the box. If not, there might be some other changes that could be made which might enable us to add this behaviour.
One option might be to enable the selectionModel to accept an array of strings or objects, and if it's an object, you can pass an id and an indeterminate flag:
selectionModel={[{id: 1, indeterminate: true]}
.Another option we tried was to actually implement our own checkbox component wrapper and pass that as the base checkbox component used by the grid. We could control the indeterminate state ourselves if the checkbox was passed the row data as a prop, but currently it isn't.
Examples 🌈
Motivation 🔦
The select all checkbox already incorporates this behaviour, so not being able to replicate that for selecting a group makes the UX inconsistent for the user.
Order ID 💳 (optional)
45574
The text was updated successfully, but these errors were encountered: