Reputation:
I use this code to delete a row in datatables.
$(".deleteRow").click(function() {
var row = $(this).closest("tr");
var nRow = row[0];
table_reach_condition_appoint_datatable.dataTable().fnDeleteRow(nRow);
});
This code is the core code in js about delete row with datatables.
I have imported the related js in my html.
When I click the link to delete, you can see the picture:
It is no effect,where is wrong?
Upvotes: 0
Views: 2303
Reputation: 86
Try with this
table.row( $(this).parents('tr')) .remove().draw();
or
table.row($(this).closest("tr")) .remove().draw();
Upvotes: 1