Bug with dataSrc ?
Bug with dataSrc ?
Hello,
this maybe a misunderstanding from myself reading the api doc,
but I think dataSrc is broken,
If you take the full code of Ajax Object example : https://datatables.net/examples/ajax/objects.html
then change the root node from "data" to, say, "list"
and use the option
"dataSrc": "list"
in init code
you get a javascript error "Uncaught TypeError: Cannot read property 'length' of undefined" in https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js
line 47
ajax data are now
{
"list": [
{
"name": "Tiger Nixon",
"position": "System Architect",
"salary": "$320,800",
"start_date": "2011/04/25",
"office": "Edinburgh",
"extn": "5421"
},
[. cut for clarity ..]
}
This question has an accepted answers - jump to answer
Answers
Seem to work okay in this example which uses
demo
rather thandata
.Are you using the
dataSrc
option as a nested property of theajax
object? Seeajax.dataSrc
.Allan
Oh damn ! You're right, it's a property of ajax. closed as answered