[DataGrid] Removal of gridEditRowsStateSelector downgrades usability #11133
Labels
component: data grid
This is the name of the generic UI component, not the React module!
dx
Related to developers' experience
feature: Editing
Related to the data grid Editing feature
Steps to reproduce
Migrating from DataGrid's v5 to v6 offers no substitute to gridEditRowsStateSelector which is essential in conditionally validating actions in a more elevated way.
Further details are included in Context section and can be seen in other issues such as #4983.
Current behavior
In v5, we could use the gridEditRowsStateSelector to retrieve current information about the cells being edited in a row, to validate the Save action.
In v6 this selector was removed and migrating involves breaking validation of row editing and conditional render on Actions column.
Expected behavior
Migrating to v6 should offer at least a valid substitute to the removed selector to some degree, in this case by providing a way to conditionally render actions based on current editing state of a row.
Context
As mentioned in this #4983 (comment) comment, I believe removing gridEditRowsStateSelector downgraded usability of DataGrid as there seems to be no clear substitute for functionalities this selector allowed to be developed.
To be more specific, in our current use of DataGrid, we needed a way to disable the save action on row editing conditionally, in such way that invalid inputs on the row cannot be submitted to the API. For v5 we solved this issue (in short) like this:
What we want to achieve is a way to abstract the "custom" datagrid, allowing for the developer to set preProcessEditCellProps for a column and a "handleError" function to the "custom" DataGrid, instead of redefining actions for every use case.
Your environment
npx @mui/envinfo
Search keywords: datagrid edit state
The text was updated successfully, but these errors were encountered: