datatables draw selected rows
datatables draw selected rows
I wanted update some column on my dtable in a multi rows selection, it work for a simple row but i have a problem with multi selection. I try this :
var selectedRows = dtable.rows('.selected').data();
for (var i = 0; i < selectedRows.length; i++) {
selectedRows[i][Col1] = val1;
selectedRows[i][Col2] = val2;
selectedRows[i][Col3] = val3;
selectedRows[i][Col3] = val4;
selectedRows[i][Col4] = val5;
}
dtable.rows('.selected').data(selectedRows).draw('page');
but it does not work, any ideas?
This question has an accepted answers - jump to answer
Answers
I would recommend using
rows().every()
to loop all the selected rows androw().data()
to update the data. Here is a simple example:http://live.datatables.net/dilijesu/1/edit
Kevin
Thanks, it's ok. I never used the every func, its really cool.