Passing rows from the server as JSON objects instead of JSON arrays
Passing rows from the server as JSON objects instead of JSON arrays
Eran
Posts: 26Questions: 0Answers: 0
Hi,
I'd like to know if passing rows from the server as JSON objects instead of JSON arrays is possible.
For example:
[code]
{ "sEcho": 1, "iTotalRecords": "1", "iTotalDisplayRecords": "1", "aaData": [ [ "Gecko", "Firefox 1.0", "Win 98+ / OSX.2+", "1.7", "A" ] ]}
[/code]
works great
yet the following code does not:
[code]
{"sEcho":1,"iTotalRecords":"1","iTotalDisplayRecords":"1","aaData":[{"engineName":"Geko","browserName":"Firefox","osName":"Windows","versionNumber":"1.7","grade":"A"}],"size":1}
[/code]
I'd like to know if passing rows from the server as JSON objects instead of JSON arrays is possible.
For example:
[code]
{ "sEcho": 1, "iTotalRecords": "1", "iTotalDisplayRecords": "1", "aaData": [ [ "Gecko", "Firefox 1.0", "Win 98+ / OSX.2+", "1.7", "A" ] ]}
[/code]
works great
yet the following code does not:
[code]
{"sEcho":1,"iTotalRecords":"1","iTotalDisplayRecords":"1","aaData":[{"engineName":"Geko","browserName":"Firefox","osName":"Windows","versionNumber":"1.7","grade":"A"}],"size":1}
[/code]
This discussion has been closed.
Replies
http://datatables.net/blog/Extended_data_source_options_with_DataTables
Example:
http://datatables.net/release-datatables/examples/server_side/object_data.html
Allan
Thanks for the quick resonse.