[data grid] Checkbox Nested Group Intermediate Select
Functionality + Select All
Functionality
#13036
Open
3 tasks done
Labels
component: data grid
This is the name of the generic UI component, not the React module!
enhancement
This is not a bug, nor a new feature
feature: Selection
Related to the data grid Selection feature
feature: Tree data
Related to the data grid Tree data feature
DataGrid Checkbox Nested Group Intermediate
Select
Functionality +Select All
Functionality@nickcarnival @cstephens-cni
I found your snippets extremely useful, but I noticed it broke in cases where nested groups were used. It also didn't allow the "select all" header to work properly.
Code below:
filter
andsort
settings to the selected rowsIt is making use of the GridApi for fetching group children (and subgroup's children) with the
apiRef.current.getRowGroupChildren
, which includes grandchildren by default. This method also automatically filters out autogenerated group row IDs. It accepts theapplyFiltering: true, applySorting: true
props which ensure the row selection applies only to the rows that haven't been filtered, in their sort-order.The code added to the
renderHeader
prop allows the "Select All" checkbox to basically function the same as the group checkboxes, only it cannot make use of theapiRef.current.getRowGroupChildren
method because that method takes a group row's id as a parameter. Unfortunately, this means we have to again manually filter out the group row IDs.Originally posted by @cclews1 in #4248 (comment)
Search keywords:
The text was updated successfully, but these errors were encountered: