How can I recieve custom vars from server?

How can I recieve custom vars from server?

mps_sudiptamps_sudipta Posts: 4Questions: 0Answers: 0
edited March 2013 in General
Like the example where we can send custom vars to the server, how can I receive some additional json vars sent by server? I need to change the datatables rendering based on some serverside settings, but as I need those only while I draw/redraw the table I don't want to fire two separate calls each time....is there a way to do this?

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    Listen for the xhr event: http://datatables.net/docs/DataTables/1.9.4/DataTable.html#xhr

    Allan
  • mps_sudiptamps_sudipta Posts: 4Questions: 0Answers: 0
    Can you please provide a sample code regarding how to do that from outside fnServerData?
  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    [code]
    $('#example').on('xhr', function ( e, o, json ) {
    // do something with the json
    } );
    [/code]

    Allan
This discussion has been closed.