Select checkboxes across paginated pages
Select checkboxes across paginated pages
rnachiappan
Posts: 2Questions: 2Answers: 0
I'm using DataTables 1.10.3 with server-side processing (web forms). I'm able to get the data through server-side with sorting, paging and filtering. How can I select checkboxes across paginated pages? What's happening now is, if I select (check) some checkboxes in one page on the paginated grid, then move to another page to select (check) more, then the selections I did on the first page are unselected (unchecked).
This discussion has been closed.
Answers
Server-side only actually loads what you see. So if you have "Showing 10 of 842" then you only actually have those 10 loaded. Then when you go to page 2, the table is drawn again and now you still have just 10 loaded, but a different 10.
I'm not sure what checking something actually does. You can store the check in your database, which is probably the best solution.
You could also store what gets checked in an object, then in a rowCallback function, check any boxes that should be checked. This is probably a bad solution unless there is some sort of submit button, otherwise the person could leave the page without actually doing whatever the checkboxes are supposed to do.