Hook to decide whether a cell is editable based on row data
We have a requirement where we want to edit only certain cells in the row based on other properties in the data
for e.g. if the category of a particular row is VIP then the name and age can be edited and if the category is Normal then only the name can be edited.
I did not find any possibility to do this in the current implementation.
Suggestion for implementation
- All specifying a function for the
editableproperty in column definition . - In the
MTableEditRowclass add the below in the renderColumns function
if (typeof columnDef.editable == 'function'){
allowEditing = columnDef.editable(columnDef, this.props.data)
}
duplicate of #690
I merged your pr. Thanks for contribution. I will publish it tomorrow.
This is published with 1.39.1
Thanks
Was an example on how to use this new feature added to the documentation, or does anyone have an example?