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.

Add onRowCancel function on editable tables

See original GitHub issue

Is your feature request related to a problem? Please describe. I have a custom edit component that is a select dropdown with two options (A, and B)

My current idea is to have a state variable that is currentRowOption set to '' initially. In my editComponent, before returning the select component, I set the state variable to the value of the row, if and only if the state variable is equal to ''. I am able to to set the state variable back to '' in the onRowUpdate function, but I need to be able to reset it if the editing is cancelled.

Describe the solution you’d like A function for onRowCancel

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

1reaction
chitgokscommented, Apr 18, 2020
components={{
        EditRow: (props) => {
          return (
            <MTableEditRow
              {...props}
              onEditingApproved={(mode, newData, oldData) => {
              }}
              onEditingCanceled={(mode, rowData) => {
              }}
            />
          );
        }}
      }

1reaction
chitgokscommented, Apr 12, 2020

This is actually not needed. you can override editable.EditRow property that returns MTableEditRow and override onEditingApproved and onEditingCanceled. this applies to both add, update and delete.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editabel Table - On Row Cancel Action | OutSystems
Hello everyone, What about adding an event handler to the onClick of the editable table and then calling a function that adds and...
Read more >
Editable | @material-table/core
Helper function. function getNewDataBulkEdit(changes, copyData) {. // key matches the column data id. const keys = Object.keys(changes);.
Read more >
material-table Make Row Editable on Click - Stack Overflow
Clicking the row should have the same effect as clicking the edit button on the leftmost side in the actions column. I have...
Read more >
Create an app to edit tables in canvas apps - Power Apps
Learn how to configure an app interface with editable tables that allow you to edit data from the data source directly through the...
Read more >
DataTable Edit - PrimeFaces Showcase
DataTable Edit. Data displayed on datatable can be edited at row or cell level. SERVER API CLIENT API. Row Editing. Code, Name, Status,...
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