Return a flat array (instead of object) when working with ajax function
Return a flat array (instead of object) when working with ajax function
UdiD
Posts: 16Questions: 7Answers: 1
When working with the ajax option, then using the "dataSrc" option with an empty string makes DataTables treat the data as a plain array. Is it possible to get the same effect when using ajax function (i.e., "ajax": function (data, callback, settings))?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes - what you would do is just wrap your JSON array in an object:
if
json
is just a plain array.Allan