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

checkbox states is lost during navigation #475

Open
sanmisasi opened this issue Sep 14, 2017 · 3 comments
Open

checkbox states is lost during navigation #475

sanmisasi opened this issue Sep 14, 2017 · 3 comments

Comments

@sanmisasi
Copy link

I have more than 100 records displayed in the reactive table each page having 5 rows, one of the column is a dynamic checkbox and the header label is also a checkbox which is select all checkbox. My issue is when I select first page checkbox and navigate to other page , the checkbox states in the first page is lost . How to keep the checkbox states when navigating to other pages and also select all does not select all the checkboxes it only selects the current page checkbox. What is the solution for retaining checkbox states during navigation?

thank you

@aslagle
Copy link
Owner

aslagle commented Sep 16, 2017

The table won't do anything automatically, but you can store the checkbox states somewhere and update the state when a box is checked or unchecked, and use the states when rendering the checkboxes. You could keep the checkbox states in a collection or in separate ReactiveVars that you look up for each item.

@sanmisasi
Copy link
Author

Can you give me a example how to store the checkbox states and render the checkbox states when navigating pages.

@aslagle
Copy link
Owner

aslagle commented Sep 19, 2017

Sorry, I don't have an example of that. You can see this example of how to create a ReactiveVar. Instead of creating one ReactiveVar like that example though, you'd need one for each row in your table, and you'd need to look it up in each row's template or function. It might be easier to use a Collection but I don't have an example of that either.

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