Adding a delete button to a fixedcolumn - how to delete the underlying table row.
Adding a delete button to a fixedcolumn - how to delete the underlying table row.
Hi, this is probably a simple question. I have a fully working datatable and everything is working fine. I need to add a fixed column that allows the user to delete rows in the table.
I have this working when the column isnt fixed using the following code:
t = $('#myTable').DataTable();
$('#myTable tbody').on('click', 'a', function() {
t
.row($(this).parents('tr'))
.remove()
.draw();
});
I understand that the fixedcolumn functionality adds a 'mask' table which is what the user is actually clicking. The above code still fires when i click the 'mask' delete button, but of course the row does not delete.
I cannot figure out what reference to use in the .row(???) part of the code.
Many thanks,
Mike