How to feed AJAX JSON response into datatables when coming inside a custom object?
How to feed AJAX JSON response into datatables when coming inside a custom object?
frequent
Posts: 23Questions: 0Answers: 0
I'm trying to setup datatables with server-side processing using Coldfusion8 and AJAX.
I have followed the examples on this page (and here: http://www.mccran.co.uk/index.cfm/2010/4/29/JQuery-Datatables-plugin-example-using-a-server-side-data-request-coldfusion), but tried to integrate the AJAX table updates into my regular AJAX routine (which handles all other database interactions).
My problem is, I'm doing all AJAX handling through a response object, which looks like this:
[code]LOCAL.Response = { Success = true, Errors = [], Data = "" } [/code]
Which works fine on getting the AJAX request to the respective script picking the table records and constructing the JSON response. However, I'm stuck on returning the data, because right now I just have Response Object like this:
[code]
{ "SUCCESS":true,
"DATA":
"{
\"sEcho\": 1,
\"iTotalRecords\": 8,
\"iTotalDisplayRecords\": 8,
\"aaData\": [
[ \"
I have followed the examples on this page (and here: http://www.mccran.co.uk/index.cfm/2010/4/29/JQuery-Datatables-plugin-example-using-a-server-side-data-request-coldfusion), but tried to integrate the AJAX table updates into my regular AJAX routine (which handles all other database interactions).
My problem is, I'm doing all AJAX handling through a response object, which looks like this:
[code]LOCAL.Response = { Success = true, Errors = [], Data = "" } [/code]
Which works fine on getting the AJAX request to the respective script picking the table records and constructing the JSON response. However, I'm stuck on returning the data, because right now I just have Response Object like this:
[code]
{ "SUCCESS":true,
"DATA":
"{
\"sEcho\": 1,
\"iTotalRecords\": 8,
\"iTotalDisplayRecords\": 8,
\"aaData\": [
[ \"
This discussion has been closed.
Replies
- HTML is ok
- The aaData was serialized twice, because I specified returnformat JSON and constructed a JSON response. I have modified it, so it passes JSLint
- I made a byPass function to return the JSON string alone.
I'm still getting some errors. Namely because I needed to add two columns in Coldfusion (HTML checkbox and action menu), which are now throwing a datatables error. If I can't solve, I will open another thread.