Get ajax to load when json source doesn't have a data wrapper

Get ajax to load when json source doesn't have a data wrapper

dandatatablesdandatatables Posts: 1Questions: 1Answers: 0

Hi,

I have DataTables set up correctly and working with a hard-coded JSON source. However, in my real-life application I have to use a JSON feed which I can't control. This JSON feed has the following format:

[ { "adminNotificationTypeId" : 11,
"customerId" : 0,
"dateTime" : "2014-05-15T20:16:00Z",
"dateTimeClosed" : "0001-01-01T00:00:00"
},
{ "adminNotificationTypeId" : 7,
"customerId" : 0,
"dateTime" : "2014-05-06T11:31:00Z",
"dateTimeClosed" : "0001-01-01T00:00:00"
},
{ "adminNotificationTypeId" : 7,
"customerId" : 0,
"dateTime" : "2014-05-06T11:31:00Z",
"dateTimeClosed" : "0001-01-01T00:00:00"
}
]

DataTable doesn't seem to like this as it's missing the wrapping 'data' JSON object.

I wondered if there's a way to get DataTables to consume this feed?

Many thanks folks.

This discussion has been closed.