By default DataTables will read the data to show in the table from the aaData property of the object returned from the server. By using the initialisation option sAjaxDataProp you can customise this to whatever you wish. This examples shows it being set to 'demo'. Note that this option will also work with server-side processing. Additionally, it is possible to set sAjaxDataProp to be an empty string, which results in DataTables treating the given data source as the table data array (rather than as property of an object).
Rendering engine | Browser | Platform(s) | Engine version | CSS grade |
---|---|---|---|---|
Rendering engine | Browser | Platform(s) | Engine version | CSS grade |
$(document).ready(function() { $('#example').dataTable( { "bProcessing": true, "sAjaxSource": "sources/custom_prop.txt", "sAjaxDataProp": "demo" } ); } );