delete row
delete row
yoppy
Posts: 1Questions: 1Answers: 0
i have : tbl_source as Datatable.
we assume the tbl_source have 3 row data.
this my event code,
$('#tbl_source tbody').on( 'click', 'tr', function () {
var data1 = tbl_source.rows().data(); // 3 row data
$(this).closest("tr").remove(); // i want to remove 1 row by event click
var data2 = tbl_source.rows().data(); // but, it's still have 3 row data (Not remove)
});
so, my question is how to really remove row in datatable?
This discussion has been closed.
Answers
Its probably best to use Datatables API's for this. See if this helps:
Kevin
Yes - you need to use the API as Kevin says. See this FAQ for why.
Allan