delete operation redraws table but changes current 'page'
delete operation redraws table but changes current 'page'
readylee
Posts: 6Questions: 0Answers: 0
I am using DataTables 1.7.6. When I attempt to implement the fnDeleteRow function, the (selected) record is indeed removed from the table....and the table is redrawn...but at that point it displays the PREVIOUS page. So if I'm on page 3 of the table when I request the delete operation, I end up on page 2 of the table.
I have the following function for deleting a row from the table:
[code]
function fnDeleteRowDT(){
var dSelected = [];
var aNodes = oTable.fnGetNodes();
for (var i=0; i
I have the following function for deleting a row from the table:
[code]
function fnDeleteRowDT(){
var dSelected = [];
var aNodes = oTable.fnGetNodes();
for (var i=0; i
This discussion has been closed.
Replies
[code]
$('#example').dataTable().fnDeleteRow($('#example tbody tr')[0]);
[/code]
to delete that first row - it stays on the same page for me. It seems to work regardless of which page I put it on. Can you link us to your example please?
Allan
So instead of calling fnDeleteRow from my fnDeleteRowDT function, I simply call fnDraw(false) after the ajax request completes. This is actually better, since I need it to be an actual DB deletion anyway. I had tried to resolve it this way before, but it seems I had to experiment with the timing of my fnDraw call before I was able to achieve consistent behavior...