Challenges with Select All checkbox as column header that checks/unchecks across pages
Challenges with Select All checkbox as column header that checks/unchecks across pages
Using the .on('page') and .on('draw') methods (thanks, Allan) I have set it up so that if the Select All checkbox is checked/unchecked, as each page is drawn, all checkboxes in that column are correspondingly checked/unchecked.
This works great as long as the user doesn't create any mixed state/exceptions, e.g. if you uncheck all on page 1, then check the first 2. (The Select All header is still unchecked.) Go to page 2, all are unchecked, as expected. Then if you go back to page 1, the ones you checked are now unchecked.
Is there a built in way to track something like this?
This works great as long as the user doesn't create any mixed state/exceptions, e.g. if you uncheck all on page 1, then check the first 2. (The Select All header is still unchecked.) Go to page 2, all are unchecked, as expected. Then if you go back to page 1, the ones you checked are now unchecked.
Is there a built in way to track something like this?
This discussion has been closed.
Replies
In case anyone else is dealing with this, a simple fix was to store a global object that tracks which elements were clicked, and then iterating through it on each page draw to make sure the proper checkboxes were checked/unchecked.