ColdFusion 10 integration

ColdFusion 10 integration

eccountableeccountable Posts: 1Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
With respect to the nicely documented example for ColdFusion (http://www.datatables.net/development/server-side/coldfusion) I was having some trouble making it work when DataTables was making a callback to the data provider. After a bit of digging, I discovered that DataTables has another property called sAjaxDataProp. This permits me to use the CF 8 function SerializeJSON() to easily populate the data source of DataTables. My rendering code now uses:
[code]
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "event_rest.cfm",
"sAjaxDataProp": "aaData.DATA", ...
[/code]
Note that I am able to access an inner data structure in the JSON data by referencing it using dot notation for the sAjaxDataProp property.

while my dataprovider page (event_rest.cfm) looks like this:
[code]

{"sEcho": #val(url.sEcho)#,
"iTotalRecords": #qCount.total#,
"iTotalDisplayRecords": #qFiltered.recordCount#,
"aaData": #SerializeJSON(cfquery_name)#
[/code]
This discussion has been closed.