1.9 syntax still being used after upgrading to 1.10.x
1.9 syntax still being used after upgrading to 1.10.x
JohnEzlab
Posts: 17Questions: 4Answers: 0
I am using 1.10.7
I am trying to use deferRender with:
$("#my_table").dataTable({
ajax: $('#my_table').data('json-source'),
deferRender: true,
dataSrc: ""
})
However I keep getting the error: "Uncaught TypeError: Cannot read property 'length' of undefined" from line 3315 of jquery.datatables.js, being the last line below:
// if there is an ajax source load the data
if ( dataSrc == 'ajax' ) {
_fnBuildAjax( settings, [], function(json) {
var aData = _fnAjaxDataSrc( settings, json );
// Got the data - add it to the table
for ( i=0 ; i<aData.length ; i++ ) {
when I look at the "settings" variable it lists:
bDeferLoading: false
sAjaxDataProp: "data"
sAjaxSource: null
I was surprised to see these columns and thought they would have had different values as I declared:
ajax: $('#my_table').data('json-source'),
deferRender: true,
dataSrc: ""
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
As the documentation for
ajax.dataSrc
shows, it is a child property of theajax
option. E.g. use:The documentation also contains other similar examples.
Allan
Thanks for the help Allan.
Deleted my uneducated reply