how to change the current page to the one where a row is inserted?

how to change the current page to the one where a row is inserted?

lighelighe Posts: 2Questions: 0Answers: 0
edited March 2011 in TableTools
Hi,

First of all, thanks for a great plugin!

I'd like to give my users the ability to add new rows via a separate form (ajax).

However, if the table is sorted and pagination is enabled, then the inserted row might end up in a page other than the currently selected one. Which is a bit of a pain, because even with a proper success message near the 'add' button, I still think that the users will get confused.

So my solution to this is: add a new row, then change the current page to the page where the row has been inserted, then briefly highlight the row.

Any ideas on how to find out on what page the row has been inserted? :)

Thanks,
Alex

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Sounds like this plug-in should do what you are looking for: http://datatables.net/plug-ins/api#fnAddDataAndDisplay .

    Allan
  • lighelighe Posts: 2Questions: 0Answers: 0
    amazing! :) thanks a lot! :)
  • arjun_adhikariarjun_adhikari Posts: 32Questions: 0Answers: 0
    the code doesnt seem to be working in my program i went exactly as stated in the plugin where am i going wrong...
    any help would be appreciated.
This discussion has been closed.