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

Modifying record data from a column #75

Closed
serhanekicii opened this issue Sep 30, 2022 · 0 comments
Closed

Modifying record data from a column #75

serhanekicii opened this issue Sep 30, 2022 · 0 comments

Comments

@serhanekicii
Copy link

serhanekicii commented Sep 30, 2022

I am trying to implement an inline-editing solution using this component. I am trying to edit the record data directly using an input component as a column, and it's onChange event to manipulate the record data as follows.

                columns={[
                    {
                        accessor: 'name',
                        title: 'Name',
                        sortable: true,
                        render: ({ name }) => (
                            <TextInput
                                defaultValue={name}
                                onChange={(event) => {
                                    name = event.currentTarget.value;
                                    console.log(name);
                                }}
                            />
                        ),
                    },

However, record data doesn't get updated.

                    {
                          key: 'save',
                          color: 'green',
                          title: 'Speichern',
                          icon: <IconDeviceFloppy size={18} />,
                          onClick: () => {
                              console.log(record.name);
                          },
                      },

Any suggestions?

@serhanekicii serhanekicii changed the title Modifying Record Data From Column Modifying record data from a column Sep 30, 2022
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

1 participant