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

[DataGridPremium] Use valueGetter to get row group keys #16016

Merged
merged 5 commits into from
Feb 20, 2025

Conversation

cherniavskii
Copy link
Member

Fixes #16015

@cherniavskii cherniavskii added bug 🐛 Something doesn't work 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 Dec 27, 2024
@@ -1605,7 +1605,7 @@ describe('<DataGridPremium /> - Row grouping', () => {
expect(getColumnValues(1)).to.deep.equal(['', '0', '3', '', '1', '4', '', '2']);
});

it('should not use valueGetter to group the rows when defined', () => {
it('should use valueGetter to group the rows when defined', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turned out that the current behavior was intentional.
I disagree with this, but maybe I don't see the full picture.
I know it's been 3 years 😅, but still – @flaviendelangle if you remember any additional details about this decision – please let me know 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed it some time ago with @michelengelen and the problem is that I don't remember the reason why we did that 😆
But I remember we did it on purpose (maybe a bad one though).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cherniavskii just a small update to say that, given I don't remember the rationals behind this current behavior AND we have a clear recurring pain point with it, I think it make sense to move forward with your PR.
The likelyhood that my rational was really important and yet that I don't remember it is pretty low

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, I already forgot about this PR!

@mui-bot
Copy link

mui-bot commented Dec 27, 2024

Deploy preview: https://deploy-preview-16016--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 3eda31f

@cherniavskii cherniavskii requested a review from a team December 30, 2024 13:52
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 13, 2025
Copy link

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

@cherniavskii cherniavskii force-pushed the row-grouping-valueGetter branch from f7bee11 to 5898f54 Compare February 17, 2025 20:22
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 17, 2025
@cherniavskii cherniavskii marked this pull request as ready for review February 17, 2025 20:36
@cherniavskii cherniavskii requested review from a team and removed request for a team February 17, 2025 20:36
Copy link
Member

@MBilalShafi MBilalShafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

export const getRowValue = (
row: GridValidRowModel,
colDef: GridColDef,
apiRef: React.MutableRefObject<GridApiCommunity>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
apiRef: React.MutableRefObject<GridApiCommunity>,
apiRef: RefObject<GridApiCommunity>,

@cherniavskii cherniavskii added enhancement This is not a bug, nor a new feature and removed bug 🐛 Something doesn't work labels Feb 20, 2025
@cherniavskii cherniavskii merged commit 4acc7e2 into mui:master Feb 20, 2025
21 checks passed
@cherniavskii cherniavskii deleted the row-grouping-valueGetter branch February 20, 2025 22:41
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! enhancement This is not a bug, nor a new feature 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] Row grouping doesn't work with derived columns (valueGetter)
4 participants