-
-
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
[DataGridPremium] Use valueGetter
to get row group keys
#16016
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It turned out that the current behavior was intentional. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 😆 |
||
render( | ||
<Test | ||
columns={[ | ||
|
@@ -1621,7 +1621,15 @@ describe('<DataGridPremium /> - Row grouping', () => { | |
defaultGroupingExpansionDepth={-1} | ||
/>, | ||
); | ||
expect(getColumnValues(0)).to.deep.equal(['Cat A (3)', '', '', '', 'Cat B (2)', '', '']); | ||
expect(getColumnValues(0)).to.deep.equal([ | ||
'value Cat A (3)', | ||
'', | ||
'', | ||
'', | ||
'value Cat B (2)', | ||
'', | ||
'', | ||
]); | ||
expect(getColumnValues(1)).to.deep.equal(['', '0', '1', '2', '', '3', '4']); | ||
}); | ||
|
||
|
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.
When the row grouping is initially enabled, the public methods aren't yet assigned to
apiRef
.I extracted the
getRowValue
method to a function so I can still call it here.This doesn't change the fact that the
apiRef
passed tovalueGetter
won't have public methods assigned yet.This makes me think that we should assign the methods (at least some of them) before initialization 🤔
mui-x/packages/x-data-grid-premium/src/DataGridPremium/useDataGridPremiumComponent.tsx
Line 165 in 2799763
WDYT?