fnDeleteRow issue
fnDeleteRow issue
Very simple: got an img int TR TD, once clicked I would live to remvove the row it is in:
var table;
$(document).ready(function() {
table = $('#props').dataTable({
"bStateSave": true,
"aaSorting": [[ 0, "asc" ]]
});
$("img.removeIcon").live('click', function(e) {
var tr = $(e.target).closest('tr').get();
console.log(tr); //prints the TR, works!
table.fnDeleteRow(tr); // simply does nothing
});
});
table.fnDeleteRow(tr) does not delete anything, nothing happens, not even an error message.
Ideas? thanx a lot!
var table;
$(document).ready(function() {
table = $('#props').dataTable({
"bStateSave": true,
"aaSorting": [[ 0, "asc" ]]
});
$("img.removeIcon").live('click', function(e) {
var tr = $(e.target).closest('tr').get();
console.log(tr); //prints the TR, works!
table.fnDeleteRow(tr); // simply does nothing
});
});
table.fnDeleteRow(tr) does not delete anything, nothing happens, not even an error message.
Ideas? thanx a lot!
This discussion has been closed.
Replies
table.fnDeleteRow(this.parentNode.parentNode.parentNode);
I just find it really ugly. What's the reason above code does not work?