material-table icon indicating copy to clipboard operation
material-table copied to clipboard

How to allow editing in one column depending on the row?

Open VictorPotes opened this issue 4 years ago • 1 comments

Hello everybody!

I know you can define when a column can be edited as it is shown on the material-table web site:

image

However what I am looking for is to be able to edit a specific column according with the data of the row.

For example:

image

Editing mode:

image

Here I have a table with four coumns, columns with their English translations: Nombre -> Name Fecha Inicio -> start date Fecha Fin -> end date Estado -> status

So what I want to do is that according with status, the columns start date and end date can be modified following the next logic:

case 1: status = scheduled ? Being able to edit column start date and end date of the current row I'm editing case 2: status = In progress ? Being able to edit column only end date of the current row I'm editing case 3: status = Another status ? It is not allowed to edit any column. (I know how to do this one)

Can anyone help me how should it be the way to achieve the cases 1 and 2? I haven't been able to figure it out.

By the way, I am using the release version 1.67.0.

Thanks in advance!

VictorPotes avatar Jan 17 '22 19:01 VictorPotes

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

stale[bot] avatar Apr 18 '22 20:04 stale[bot]