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

OnEdit #2

Open
imbundle opened this issue Jul 6, 2020 · 8 comments
Open

OnEdit #2

imbundle opened this issue Jul 6, 2020 · 8 comments

Comments

@imbundle
Copy link

imbundle commented Jul 6, 2020

How can I access to the selected row after select one row and click onEdit?

@michaelbdavid
Copy link

@imbundle did you ever find a way to do this? I'm also seeing issues with the value returned from onEdit doesnt seem to contain the selected rows.

@ggascoigne
Copy link
Owner

well the onEdit is pretty stubbed out (it passes in a dummy function), but the prototype for onEdit in this example shows that it passes the table instance through to the callback, so you can see what's selected by accessing instance.selectedFlatRows.

@ggascoigne
Copy link
Owner

I'll add, that this is more of a random example about how to get typescript working with react-table v7 - it's very limited, intentionally.

@michaelbdavid
Copy link

@ggascoigne hey thanks for the reply. I still must be missing something. Just dumping the returned value from your dummy function im not seeing .selectedFlatRows.
See screenshot of console for this.

selectedFlatRowsMissing

@michaelbdavid
Copy link

michaelbdavid commented Jan 29, 2021

nvm I figured this out. The value returned by the first callback was hidden by the second due to they are both named a :(

Thanks for the help on this Guy!

@tacticalCoder
Copy link

I am having the same problem with using onAdd and onEdit and I am not seeing instance.selectedFlatRows in the dump either. Any help would be greatly appreciated.

@ggascoigne
Copy link
Owner

Take a look at 7080fba, it should make things clearer. Note that I was in a hurry so all it does is log to the console.

@tacticalCoder
Copy link

Thanks, It helped a lot !

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

4 participants