How do you deselect rows that are not part of the current filter?
How do you deselect rows that are not part of the current filter?
http://live.datatables.net/nijojoru/1/edit
How to reproduce:
1) Select the first two rows by clicking on the checkboxes.
2) In the "Search" textbox at the top, type in "0", so that the second row is excluded from the selection.
3) Click on the "Delete Selected Rows" button at the top and in the Console the first two rows (0 and 1) are listed, indicating that both rows are present in the .select()
DESIRED RESULTS: only the first row (row 0) would be displayed when the "Delete Selected Rows" button is clicked and the second row would be excluded.
We need rows that are no longer visible (due to being removed by a filter) to be excluded from .select().
This question has an accepted answers - jump to answer
Answers
Similar to my answer in your other thread, use the
selector-modifier
of{selected: true}
to get the selected rows. And add{search: "applied"}
to get only those rows that are filtered. Updated example:http://live.datatables.net/nijojoru/2/edit
Kevin
That resolved the issue, thank you @kthorngren!