Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass method to disable row edit in custom editor ? #369

Open
Ezekiah opened this issue Mar 6, 2019 · 1 comment
Open

How to pass method to disable row edit in custom editor ? #369

Ezekiah opened this issue Mar 6, 2019 · 1 comment

Comments

@Ezekiah
Copy link

Ezekiah commented Mar 6, 2019

Hello,
Like onValue is passed on the custom editor, I would like to know if I can pass a method such as onDeactivate to disable editing on a cell ?

const editable = edit.edit({
...
onDeactivate:({ value, rowData, property }) => {
      const index = findIndex(this.state.rows, { id: rowData.id });
      const rows = cloneDeep(this.state.rows);
      rows[index].editing = false;
      this.setState({ rows });
    },

....

@bebraw
Copy link
Member

bebraw commented Mar 6, 2019

To do this, it's likely you'll have to modify the edit wrapper at https://github.com/reactabular/react-edit . PR welcome. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants