Accessing the ajax server response object

Accessing the ajax server response object

neptunianneptunian Posts: 6Questions: 0Answers: 0
edited February 2012 in General
[code]
var wTable = $('#workflowsTable').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "/api/jobs/workflows",
"aoColumns": [
{ "mDataProp": "status" },
{ "mDataProp": "label" },
{ "mDataProp": "jobs_complete" },
{ "mDataProp": "workflow" },
{ "mDataProp": "jobs_failed" },
{ "mDataProp": "jobs_waiting" },
{ "mDataProp": "start" },
{ "mDataProp": "end" }
]
});

[/code]

Here is the extent of my code and my table is working nicely. But i'd like to access the return json object somehow.. similar to what the jquery $.ajax() function does. I would like to perhaps do some logic before the data actually populates the table. For eg if a property is empty than display some custom piece of text. Is this possible?

Thanks!

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Sounds like fnServerData is just want you want. You'll be able to intercept the JSON return and do whatever processing you want on it.

    Allan
  • neptunianneptunian Posts: 6Questions: 0Answers: 0
    edited February 2012
    I'm using fnServerData althoguh still not sure where the data object is.
  • neptunianneptunian Posts: 6Questions: 0Answers: 0
    Thanks, i think I understand better after seeing this example: http://datatables.net/examples/server_side/custom_vars.html
This discussion has been closed.