reactive-table icon indicating copy to clipboard operation
reactive-table copied to clipboard

checkbox states is lost during navigation

Open sanmisasi opened this issue 8 years ago • 3 comments

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

sanmisasi avatar Sep 14 '17 05:09 sanmisasi

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.

aslagle avatar Sep 16 '17 15:09 aslagle

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

sanmisasi avatar Sep 18 '17 05:09 sanmisasi

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.

aslagle avatar Sep 19 '17 02:09 aslagle