How to force reaload and pass some additional data

How to force reaload and pass some additional data

vuceticavucetica Posts: 15Questions: 0Answers: 0
edited August 2009 in General
Hi. Thanks for such a great component!
I have a datatables setup (1.5 b11) which goes to the server side to get the data. Is there any way to force reload of that data, and pass some additional parameters via get? I can make a get with fnReloadAjax (there are examples on this forum), but with those examples there are two problems:
1. It goes to the server two times, one the default one, and the one where I make my ajax call
2. I should post the datatables specific data, but can not get all the required data, since I really want to keep paging and sorting info (there is also some echo parameter and a lots of stuff).
I would appreciate any help on this one. Thanks!

Replies

  • fliesflies Posts: 35Questions: 0Answers: 0
    Regarding additional parameters. Take a look here: http://datatables.net/1.5-beta/examples/server_side/custom_vars.html
  • vuceticavucetica Posts: 15Questions: 0Answers: 0
    Thanks for a quick response! Is there any way I can tell to datatables: just refresh now! When I call $("something").datatables again, it redraws the whole table together with the header and footer.
  • allanallan Posts: 61,439Questions: 1Answers: 10,052 Site admin
    Hi vucetica,

    You can't called $().datatable() twice on the same element, as yo uhave seen, as this re-initialised your whole table. If you are using server-side processing, all you need to do is call fnDraw ( http://datatables.net/api#fnDraw ), and the table will be refreshed using the current parameters from the server.

    Allan
  • vuceticavucetica Posts: 15Questions: 0Answers: 0
    Thanks guys! This works perfectly!
This discussion has been closed.