Using fnDeleteRow removes wrong row after 1 or more rows are deleted.
Using fnDeleteRow removes wrong row after 1 or more rows are deleted.
Version: 1.8.2
I am using datatables and allowing the user to remove row dynamically. However, I have ran into the issue that if you delete from the top down, row 0 being the first row index. The wrong row will be deleted anytime you try to delete a row after that, assuming you dont refresh the page.
This is how i am using it:
[code]
if(msg == "done"){
var oTable = $j('#example').dataTable();
oTable.fnDeleteRow(row, null, true);
}
[/code]
Am i not using this correctly or maybe there is a work around. I cannot redraw the table because there could be a running process in the table at the same time the row is deleted.
I am using datatables and allowing the user to remove row dynamically. However, I have ran into the issue that if you delete from the top down, row 0 being the first row index. The wrong row will be deleted anytime you try to delete a row after that, assuming you dont refresh the page.
This is how i am using it:
[code]
if(msg == "done"){
var oTable = $j('#example').dataTable();
oTable.fnDeleteRow(row, null, true);
}
[/code]
Am i not using this correctly or maybe there is a work around. I cannot redraw the table because there could be a running process in the table at the same time the row is deleted.
This discussion has been closed.
Replies
Allan
[code]
onclick="doingIt(oObj.iDataRow)"
[/code]
And this is working up to the point where the row(s) are deleted.
Should I be using something like fnGetPosition() to find the row? If so,
[code]
aPos = oTable.fnGetPosition( this )[0];
console.log("outside "+ aPos);
[/code]
gives me this error:
[code]
Uncaught TypeError: Cannot call method 'toUpperCase' of undefined
[/code]