Deleting wrong rows...?
Deleting wrong rows...?
driekus
Posts: 2Questions: 1Answers: 0
Hi all,
Below is a part of the delete function I'm using in my project. Big bug is that when selecting multiple rows in datatable the first is always deleted properly but for the rest I'm getting back the wrong data (ids) from datatable.
The code I'm using:
dt.rows('.selected').every(function (rowIdx, tableLoop, rowLoop) {
var data = this.data();
// Callback to registered removeRow function
settings.removeRow.action(dt, data);
dt.row(rowIdx).remove().draw();
});
Am I doing something wrong heir? Or is it a bug in Datatables?
Kind regards,
Henry
This discussion has been closed.
Answers
Fixed it myself. The remove.draw() has to be done at the end of all row removeal!