.row().data().invalidate().draw() causes table to reload

.row().data().invalidate().draw() causes table to reload

modenmoden Posts: 11Questions: 4Answers: 0
edited November 2017 in Free community support

I am trying to preform a single row update of a ajax enabled datatable. I update the row using the following code:

oTableErrors.row(itemrow).data(item).invalidate().draw();

where item contains the updated object from the server.

The table reloads instead of just drawing the one line.

What am I doing incorrectly?

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947

    Are you using server side processing?

    If so the draw() will request the current page data each time its executed.

    Kevin

  • modenmoden Posts: 11Questions: 4Answers: 0
    edited November 2017

    OK, so is there a way to update a row in data table that is using server side processing without refreshing the whole table?

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    No. Server-side processing fundamentally means that every draw of the table will make an Ajax request to the server to get the data for the page. If you want to refresh the data shown, it needs to make an Ajax request to get the 10 rows (or whatever) again.

    Allan

This discussion has been closed.