the row is not deleted from datatable when i remove it from the dom
the row is not deleted from datatable when i remove it from the dom
master55
Posts: 5Questions: 0Answers: 0
Hi i use datatables 9, and when i remove a row with $('tr[id="'+idProduit+'"]').remove(); because fnDeleteRow($('tr[id="'+idProduit+'"]')) doesn't work, and after removing i search this row in the search input the row is still there, why? i have tried this :
$('.suppBtn').on('click',function(){
var aPos = tblPrdt.fnGetPosition(this);
tblPrdt.fnDeleteRow(aPos); =>doesn't work
}
i have also tried this :
$('tr[id="'+idProduit+'"]').remove(); =>works but the row is already in the table when i search
tblPrdt.fnDeleteRow($('tr[id="'+idProduit+'"]')); he delete the first row all time
also : tblPrdt.fnDeleteRow($('tr[id="'+idProduit+'"]'),null,true); => same problem
help me please, because this is a great plugin, but i had a lot of problems because of this, and the temporary solution that i have is to reload the page but that touch the performance of the application.
$('.suppBtn').on('click',function(){
var aPos = tblPrdt.fnGetPosition(this);
tblPrdt.fnDeleteRow(aPos); =>doesn't work
}
i have also tried this :
$('tr[id="'+idProduit+'"]').remove(); =>works but the row is already in the table when i search
tblPrdt.fnDeleteRow($('tr[id="'+idProduit+'"]')); he delete the first row all time
also : tblPrdt.fnDeleteRow($('tr[id="'+idProduit+'"]'),null,true); => same problem
help me please, because this is a great plugin, but i had a lot of problems because of this, and the temporary solution that i have is to reload the page but that touch the performance of the application.
This discussion has been closed.
Replies
the table are :
....
xx
33
Delete
....
when i click on Delete, how can i remove it with fnDeleteRow?
You must use the API to tell the DataTable that the rows are being updated. It can't know that you have removed an element from the DOM!
Allan
the table are :
....
xx
33
Delete
....
Allan
thanks for the support.