.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: 20,276Questions: 26Answers: 4,765

    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: 61,665Questions: 1Answers: 10,096 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.