-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] New api method: getRowGroupChildren
#4304
[data grid] New api method: getRowGroupChildren
#4304
Conversation
getGroupingCriteriaRows
These are the results for the performance tests:
|
docs/data/data-grid/group-pivot/RowGroupingGetGroupingCriteriaRows.js
Outdated
Show resolved
Hide resolved
getGroupingCriteriaRows
getGroupingCriteriaRows
docs/data/data-grid/group-pivot/RowGroupingGetGroupingCriteriaRows.js
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid-pro/src/hooks/features/rowGrouping/gridRowGroupingInterfaces.ts
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid-pro/src/hooks/features/rowGrouping/useGridRowGrouping.tsx
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid-pro/src/tests/rowGrouping.DataGridPro.test.tsx
Outdated
Show resolved
Hide resolved
packages/grid/x-data-grid-pro/src/utils/tree/getNonAutoGeneratedDescendants.ts
Outdated
Show resolved
Hide resolved
docs/data/data-grid/group-pivot/RowGroupingGetGroupingCriteriaRows.tsx
Outdated
Show resolved
Hide resolved
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the getGroupingCriteriaRow
name might be a bit confusing.
If I understand it correctly, it returns the grouped rows using the data grid's visualization criteria, and if that's the case, I'd be in favor of simplifying the name to getGroupedRows
.
GroupId, applyFiltering and applySorting as parameters help complement the function description.
It'd also be more coherent when actually trying to get rows by GroupingCriteria when combing the call with getGroupRowIdFromPath
, which I'd then propose to rename to getGroupIdForGroupingCriteria
Co-authored-by: José Rodolfo Freitas <joserodolfo.freitas@gmail.com>
getGroupingCriteriaRows
getRowGroupChildren
2d5da8b
to
77a139e
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Where's the page section under the new structure? |
@joserodolfofreitas oops I lost it when merging with the new split doc page. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
I am merging it since it has been approved with its prior name |
Closes #4270
Part of #4248
Doc preview:https://deploy-preview-4304--material-ui-x.netlify.app/x/react-data-grid/row-grouping/#get-the-rows-in-a-group
Add a new method
apiRef.current.getRowGroupChildren
By default, this method returns all the rows inside a grouping criteria except the auto generated ones (do not return the subgroups but there descendants).
For instance the rows of
Group A
are[Element 1, Element 2, Element 3]
, the rows ofGroup A A
are[Element 1, Element 2]
getGroupRowIdFromPath
to easily create the id of a grouping row. If you prefer we can do the opposite (provide the path togetGroupingCriteriaRows
and add a methodgetGroupPathFromGroupRowId
)