fnDrawCallback for server side datatables ?

fnDrawCallback for server side datatables ?

peipstpeipst Posts: 7Questions: 0Answers: 0
edited March 2013 in General
Hi, I am using DataTables with server side datasource. A few exta rows should be generated, content is delievered through the JSON object from the server. In my special case I need to show a table about files and folders, those folder names are inside the JSON object. Because folders should look different (colspan etc.) I need to generate them through JavaScript. I've searched a callback which gets called after fnDraw is done to place my row generation there but from fnDrawCallback I cant access the JSON object. Any ideas solving my problem?

PS: I'm using newest Datatables + jQuery 1.9.1 (+migrate library).

Kind regards, peipst

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    You can get the last JSON from `settings.jqXHR.responseText` and parse it to JSON using $.parseJSON . The other option is to listen for the `xhr` event.

    Allan
  • peipstpeipst Posts: 7Questions: 0Answers: 0
    edited March 2013
    $.parseJSON(oSettings.jqXHR.responseText);

    Works perfectly, thanks allan!
This discussion has been closed.