How to use fnReloadAjax() with new sAjaxSource?

How to use fnReloadAjax() with new sAjaxSource?

renevanhrenevanh Posts: 13Questions: 1Answers: 0
edited May 2012 in DataTables 1.9
While building a webbased application I ran into DataTables. Great stuff, I wasn't very keen on building a similar table myself.

I'm using an Ajax source which returns JSON data (own script). The sourcecode retrieves data from a database based on a $_GET variable (which is provided by clicking on node in JStree). This means that I need a new Datatables table everytime a new node is clicked.

I tried using fnReloadAjax(), but this simply does a new call to the source without 'reading' the sAjaxSource variable again. Changing the $_GET variable is therefor impossible.

How could I achieve what I want to do? I'm thinking about manipulating the variable in which the sAjaxSource is stored, but I have no idea which variable that might be, the Datatables script is quite long...

Replies

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Just pass it as the first parameter to the plug-in: table.fnReloadAjax('myNewXhrAddress.php');

    Allan
  • renevanhrenevanh Posts: 13Questions: 1Answers: 0
    It's that easy?

    Great!!
This discussion has been closed.