BUG: dataTable script handling of Searched Terms with Checkboxes ticked
I've noted that when there are checkboxes ticked, the behaviour of searching is undesirable and really a bit of a bug. There are two issues:
**Issue 1: Toolbar stays in CheckBox mode when searching**
Steps to Re-create:
1. in a dataTable list (rendered on client-side), check a couple of items
2. then add search terms in search box
1. the checked toolbar should remain visible
1. the checked toolbar disappears
**Issue 2: CheckBox items disappear if selected during a search**
Steps to Re-create:
1. in a dataTable list (rendered on client-side), add search terms in search box
2. check the desired items
3. delete the search terms in the search box
1. the checked items should appear in the list (also with the toolbar remaining)
1. The checked items and toolbar appear as though nothing is checked, however, if the search terms are added back, the initially checked items are still checked. That means the dataTables hasn't cleared the checks, even though the checked items are no longer visible and for all intents and purposes, looked reset.
1. When items are checked, these are pinned in place, so that when search terms are added, they remain onscreen.
2. When search terms are added, the checkbox toolbar remains visible, and will continue to remain visible until all items are unchecked.
This is pretty critical because the items are still checked even when not visible, so any scripting I do to delete checked items, can occur without visibility to the user. (ie. when using a batch delete function based on the checked items).
Hi Sean, please don't worry about this one. I've figured out a workaround.
I've used the order() api to automatically re-order the table whenever a checkbox is ticked, this has the effect of pinning ticked items to the top, and changed the addClass to a toggle() that only switches when the total number of selected items is 0 or >0.