Updating row data without redrawing table

Updating row data without redrawing table

sjw01sjw01 Posts: 67Questions: 36Answers: 1

Link to test case: http://live.datatables.net/weqorujo/1/
Description of problem: In the example above, the user can update specific settings in the DataTable which makes an Ajax request back to the DB, saves the data and then updates the row to show the new value.
When I update the row with the new value, I issue:

table .row( tr ) .data( row ) .draw();

The Problem: If I edit a value on Page 3, when I issue the .draw() the DataTable kicks me back to page 1. Is it possible to maintain the page state?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,055 Site admin
    Answer ✓

    If you check the draw() docs you'll see you can pass false to stop it from resetting the paging:

    table
     .row( tr )
     .data( row )
     .draw( false );
    

    Should do what you need.

    Allan

Sign In or Register to comment.