Hook to decide whether a cell is editable based on row data
See original GitHub issueWe 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
editable
property in column definition . - In the
MTableEditRow
class add the below in the renderColumns function
if (typeof columnDef.editable == 'function'){
allowEditing = columnDef.editable(columnDef, this.props.data)
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
What is the best way to hint that a table cell is editable?
I think an icon can be done in a way to not clutter so much. Try using vey low contrast (light gray) icons...
Read more >How to know if a row of Jtable is editable? - Stack Overflow
1 Answer 1 ... to control which cells are editable, you will need to extend either JTable or JTableModel (see the call to...
Read more >Data Grid - Editing (legacy) - MUI X
In this demo, only the rows with an even Age value are editable. The editable cells have a green background for better visibility....
Read more >Cell Editing - React Data Grid
An editable callback is added to the Athlete and Age columns to control which cells are editable based on the selected Year. A...
Read more >JavaScript Data Grid Events and hooks - Handsontable
If you only react to emitted hooks and forget about all their other ... spliceCol, Action triggered by Handsontable after the column data...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Was an example on how to use this new feature added to the documentation, or does anyone have an example?
Thanks