Passing rows from the server as JSON objects instead of JSON arrays

Passing rows from the server as JSON objects instead of JSON arrays

EranEran Posts: 26Questions: 0Answers: 0
edited November 2012 in DataTables 1.9
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]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Blog post:
    http://datatables.net/blog/Extended_data_source_options_with_DataTables

    Example:
    http://datatables.net/release-datatables/examples/server_side/object_data.html

    Allan
  • EranEran Posts: 26Questions: 0Answers: 0
    Hi Allan,

    Thanks for the quick resonse.
This discussion has been closed.