question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hook to decide whether a cell is editable based on row data

See original GitHub issue

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 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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
theodore-kochcommented, Jul 1, 2019

Was an example on how to use this new feature added to the documentation, or does anyone have an example?

1reaction
mohitmuthacommented, Jun 14, 2019

Thanks

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found