fnDeleteRow does not accept a jquery object

fnDeleteRow does not accept a jquery object

rkralstonrkralston Posts: 3Questions: 0Answers: 0
edited June 2012 in DataTables 1.9
Code:


function deleteClick(btn){
var tablerow=$(btn).closest('tr').get(0);
var id=$(btn).attr("value");
$.ajax({
url:'/com/PlatformHelper.cfc?method=deleteCollection&platformID=#platform.getID()#&collectionID=' + id,
method:'POST',
success:function(){
$('##collections').dataTable().fnDeleteRow(tablerow);
},
error:function(jqXHR, textStatus, errorThrown){
alert(textStatus + ':\n\n' + errorThrown);
}
});
return false;
}

Issue: calling fnDeleteRow without using .get(0) on tablerow deletes the first row. Pulling the DOM object out of the jQuery object with .get(0) works fine.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    That is correct - as noted in the fnDeleteRow documentation it expects node. In future I'll expand this to support jQuery objects.

    Allan
This discussion has been closed.