Open tjgibbs92 opened 1 year ago
Also when the Aggregation Model is in play, the Age field cannot be edited either while the other non-aggregated fields can be.
As alternative, you can use getCellClassName
:
<DataGrid
getCellClassName={() => editable ? 'editable' : ''}
/>
As alternative, you can use
getCellClassName
:<DataGrid getCellClassName={() => editable ? 'editable' : ''} />
Yes but that would apply to the entire grid. It doesn't doesn't allow granular control of my columns.
getCellClassName
is called with a GridCellParams
object. You can return different class names depending on the column.
Okay, getCellClassName solves the className being applied. It doesn't fix the issue that allows Age to be editable while being aggregated.
Do I need to open another issue to handle the aggregation preventing the cell from being edited or is it tied to this same issue here?
Do I need to open another issue to handle the aggregation preventing the cell from being edited or is it tied to this same issue here?
Is that problem reproducible with the codesandbox above?
Yes. When toggling it the state, the aggregated column ignores the rule if the cell can be edited or not. It just holds the initial state.
The main issue that is still persisting when there is an aggregation existing, the column cannot be edited when controlled from an external state. It works by toggling the editing and by commenting the aggregationModel in and out to see the issues. This is preventing our team from upgrading MUI X to the latest data grid versions.
Version 6.9.2 was the last version that worked properly.
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/s/vigilant-goldstine-wl7pj5?file=/src/App.js:1681-1694
Steps:
Current behavior 😯
We have a cell class style applied when the grid is in an editable state and show's what modifiable. However, when the column has an aggregation associated with it, it doesn't trigger the class style on state change.
Expected behavior 🤔
I expect age to highlighted blue like name and join date.
Context 🔦
Trying to show what columns are editable based on if the grid can be edited.
Your environment 🌎
No response
Order ID or Support key 💳 (optional)
58533