Skip to content
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

Merged
merged 27 commits into from
Apr 29, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Mar 29, 2022

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 of Group A A are [Element 1, Element 2]

Group A
  Group A A
    Element 1
    Element 2
    Aggregation Footer
  Group A B
    Element 3
  • Support filtering
  • Support sorting
  • Support models with several elements
  • New method getGroupRowIdFromPath to easily create the id of a grouping row. If you prefer we can do the opposite (provide the path to getGroupingCriteriaRows and add a method getGroupPathFromGroupRowId)
  • Doc example
  • Tests

@flaviendelangle flaviendelangle added component: data grid This is the name of the generic UI component, not the React module! plan: Premium Impact at least one Premium user feature: Row grouping Related to the data grid Row grouping feature labels Mar 29, 2022
@flaviendelangle flaviendelangle self-assigned this Mar 29, 2022
@flaviendelangle flaviendelangle changed the title [data-grid] New api method: getGroupingCriteriaRows [data-grid] New api method: getGroupingCriteriaRows Mar 29, 2022
@mui-bot
Copy link

mui-bot commented Mar 29, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 243.9 493.9 435.6 372.74 105.369
Sort 100k rows ms 417.5 997.7 782.5 720.06 195.302
Select 100k rows ms 124.8 225.8 174.8 176.78 38.895
Deselect 100k rows ms 104.8 273.6 151.1 172.88 59.999

Generated by 🚫 dangerJS against 25fb4d7

@flaviendelangle flaviendelangle marked this pull request as ready for review March 30, 2022 12:20
@flaviendelangle flaviendelangle changed the title [data-grid] New api method: getGroupingCriteriaRows [data grid] New api method: getGroupingCriteriaRows Mar 31, 2022
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 9, 2022
@github-actions
Copy link

github-actions bot commented Apr 9, 2022

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Member

@joserodolfofreitas joserodolfofreitas left a 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

docs/data/data-grid/group-pivot/group-pivot.md Outdated Show resolved Hide resolved
docs/data/data-grid/group-pivot/group-pivot.md Outdated Show resolved Hide resolved
docs/data/data-grid/group-pivot/group-pivot.md Outdated Show resolved Hide resolved
Co-authored-by: José Rodolfo Freitas <joserodolfo.freitas@gmail.com>
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 20, 2022
@flaviendelangle flaviendelangle changed the title [data grid] New api method: getGroupingCriteriaRows [data grid] New api method: getRowGroupChildren Apr 20, 2022
@flaviendelangle flaviendelangle force-pushed the getGroupingCriteriaRows branch from 2d5da8b to 77a139e Compare April 20, 2022 13:27
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 22, 2022
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 22, 2022
@joserodolfofreitas
Copy link
Member

@flaviendelangle
Copy link
Member Author

@joserodolfofreitas oops I lost it when merging with the new split doc page.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 27, 2022
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 27, 2022
@flaviendelangle
Copy link
Member Author

I am merging it since it has been approved with its prior name

@flaviendelangle flaviendelangle merged commit 643336a into mui:master Apr 29, 2022
@flaviendelangle flaviendelangle deleted the getGroupingCriteriaRows branch April 29, 2022 08:01
alexfauquette pushed a commit to alexfauquette/mui-x that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 plan: Premium Impact at least one Premium user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data-grid] Add a method to get all the real rows of a group created with row grouping
5 participants