I'm using datagrid-pro from MUI to create a table component. I want the user to be able to switch a row from view mode to edit mode by double-clicking on a row or by using an edit action-button on each row.
My problem is with the edit action-button and when there already is a row on edit mode. Basically I want to close and resolve the row in edit mode before opening a new one, however if the data are not valid I want to keep the current row in edit mode, display a tooltip with the errors, and the row that the user intended to open with the action-button must remain in view mode.
I managed to achieve this behaviour for the double-click. But I don't really know how to do it in the function triggered by my edit action-button, my first attempt was to manually update the row mode model, but I need to know if the previous row was resolved with an error or not, which is determined in the processRowUpdate function.
So I guess I need to fire an event (I don't know which one, a resolve event or something like that) which trigger processRowUpdate then await for the processRowUpdate to set my error to true or false, then use this error to change the row mode model. But I don't find a way to do that.
I know my problem is a bit vague, but I just need a few clues to point me in the right direction.
Thank you