fnUpdate refreshes table and jumps to page 1

fnUpdate refreshes table and jumps to page 1

[Deleted User][Deleted User] Posts: 0Questions: 2Answers: 0
edited December 2011 in DataTables 1.8
Hi,

After I use fnUpdate to update data in a row on a paginated table, the table jumps to page 1.

Is there any way to do the update, and react differently depending on whether the row being updated is currently being displayed on screen?

Example 1
- Currently on page 2 of the table.
- Row being updated is displayed.
- Row is updated in internal cache AND on screen.
- Stay on page 2.

Example 2
- Currently on page 2 of the table
- Row being updated is on page 1
- Row is updated in internal cache only.
- Stay on page 2.
- If user goes to page 1, updated row is displayed as it is taken from cache.

Can you follow these examples?

I know that fnUpdate has the redraw true/false parameter. Is it possible to do what I'm doing above and work out whether or not to set redraw to true or false ?

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Set the redraw option for fnUpdate to false and then use the standing redraw plug-in: http://datatables.net/plug-ins/api#fnStandingRedraw

    Allan
  • [Deleted User][Deleted User] Posts: 0Questions: 2Answers: 0
    Brilliant, thanks
This discussion has been closed.