fnDeleteRow deletes wrong row
fnDeleteRow deletes wrong row
rwillmer
Posts: 10Questions: 1Answers: 0
The data has been loaded via Ajax.
Here's a testcase: http://hobthross.com/watchlist/testcase
If you click on the 'Del' button in the first one "Art of Scalability", a row is deleted from the table but it's not this one. Same for "Curse of the Pogo Stick".
(In the live version of this code, that click function will also delete the row from the backend database; that's not being done here for simplicity)
The displayed rows have been sorted by datatables; my theory is that the problem is related to a mismatch between the order of the rows returned by the ajax call and the order they're displayed in.
Here's a testcase: http://hobthross.com/watchlist/testcase
If you click on the 'Del' button in the first one "Art of Scalability", a row is deleted from the table but it's not this one. Same for "Curse of the Pogo Stick".
(In the live version of this code, that click function will also delete the row from the backend database; that's not being done here for simplicity)
The displayed rows have been sorted by datatables; my theory is that the problem is related to a mismatch between the order of the rows returned by the ajax call and the order they're displayed in.
This discussion has been closed.
Replies