DataTables and AJAX
DataTables and AJAX
cduicu
Posts: 2Questions: 0Answers: 0
Hi, I am a noob with datatables so please forgive me if I ask a very trivial question.
I have a problem with AJAX loaded table: when I configure sDom property and make it load the data via AJAX there is an error reported: "Uncaught TypeError: Cannot read property 'length' of undefined ". If I remove the sDom it works fine. Also if I keep the sDom and remove the AJAX loading it works fine. Any help is greatly apreciated.
Here is the code:
HTML:
[code]
Col1Col2Col3
[/code]
JS:
[code]
var $table = $('#test');
$table.dataTable( {
"sDom": 'tif',
"bDeferRender": true, "bProcessing": true, "sAjaxSource": "/test/0"
} );
[/code]
Here is a jsFiddle to reproduce the error: http://jsfiddle.net/cduicu/Mbj9b/
I have a problem with AJAX loaded table: when I configure sDom property and make it load the data via AJAX there is an error reported: "Uncaught TypeError: Cannot read property 'length' of undefined ". If I remove the sDom it works fine. Also if I keep the sDom and remove the AJAX loading it works fine. Any help is greatly apreciated.
Here is the code:
HTML:
[code]
Col1Col2Col3
[/code]
JS:
[code]
var $table = $('#test');
$table.dataTable( {
"sDom": 'tif',
"bDeferRender": true, "bProcessing": true, "sAjaxSource": "/test/0"
} );
[/code]
Here is a jsFiddle to reproduce the error: http://jsfiddle.net/cduicu/Mbj9b/
This discussion has been closed.
Replies
and
> "sDom": 'tif'
You've enabled processing, but not included the processing element. So add `r` to your sDom and that should be it.
Allan