I have a MUI data grid with different cells types.
I have to check the option to edit cell by user permissions. I want to do that inside renderEditCell
– only after the user try to edit, don’t want to render the permission testing for any cell in the initial table render in order to improve the grid performance.
Also, I need the params
to check the permission so I can’t check it in column level.
I try to do that like this but I get the view component inside edit mode.
renderEditCell: params => hasPermission(params.row.id, userId) ? renderEditMode(params) : renderViewMode(params),
How can I do that without get the edit mode if the user don’t have a permission to edit?