Best way to remove unselected rows
Best way to remove unselected rows
Pennywise
Posts: 15Questions: 3Answers: 1
I have a table where clicking a button removes selected rows. My code for that is:
``` $('#cutSelectedButton').click(function () {
var table = $('#homeTable').DataTable();
var rows = table.rows('.selected').remove().draw();
});
However, I would also like to have another button that removes only those rows that AREN'T selected. What is the best way of accomplishing this?
This discussion has been closed.
Answers
I seemed to have solved this by toggling my unselected rows to selected and my selected rows to unselected and then removing selected rows as follows: