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 use one table row selection result to update other tables. #343

Open
secondbookwormai opened this issue Oct 19, 2023 · 1 comment

Comments

@secondbookwormai
Copy link

I have 4 tables, table A, table B, table C, table D.
the user can filter any one of 4 tables.
For example, the user filter Table B first, by select gender = 'Male", then I would like to update all three other tables with information only males. (gender is a variable in Table B)
then the user look at the table C, filtering Table C by country = "USA", then I would like table A, B, D are updated with gender = Male and country = USA. (country is a variable in Table C)
then the user go to table D ( table D only have information about gender = MALE and country = USA), filter the table D by Degree = PHD, (degree is a variable in Table D).
any idea to do it ?
I am trying to use reactivevalues to keep all updated tables in each step.

@glin
Copy link
Owner

glin commented Oct 23, 2023

Hi, the general way to do this would be to use the reactive row selection state from one table, e.g. getReactableState("table", "selected"), and use that to update a different table's selection state using updateReactable(). Here are some doc examples on both:

I couldn't quite understand your example, so I think it'd help if there was some example code if you had any (even if it doesn't work yet).

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