fnDeleteRow issue

fnDeleteRow issue

hansamannhansamann Posts: 2Questions: 0Answers: 0
edited May 2011 in General
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!

Replies

  • hansamannhansamann Posts: 2Questions: 0Answers: 0
    ok, so this works:

    table.fnDeleteRow(this.parentNode.parentNode.parentNode);

    I just find it really ugly. What's the reason above code does not work?
This discussion has been closed.