Parsing json with aaData

Parsing json with aaData

andrew1986andrew1986 Posts: 12Questions: 5Answers: 0
edited April 2014 in DataTables
Hi guys,

I am basically new at this, and I´m having some issues create tables cause I cannot get json format in the right way, for sample, my php function return a json which looks like:

{
" value 1": [
{
"name": "the name",
"last name": "the last name"

}
],
" value 2": [
{
"name": "the name",
"last name": "the last name"

}
]
}

However I need it as "aaData" which is driving me crazy. Any advises??

Thanks a ton!!!

Replies

  • allanallan Posts: 63,572Questions: 1Answers: 10,482 Site admin
    You can use sAjaxDataProp and set it to be an empty string to read from a plain array. However, it looks like you are returning an object at the moment, which is not supported by DataTables at this time. The list or data data must be in an array. You'd need to either alter the JSON return from the server or modify the JSON data received at the client-side.

    Allan
This discussion has been closed.