Trying to get nested array data source for columns

Trying to get nested array data source for columns

andrewbaderaandrewbadera Posts: 2Questions: 1Answers: 0
edited February 2015 in Free community support

When data is returned from a Web API 2.2 OData v4 controller with an OData metadata wrapper, I'm having trouble properly sourcing columns in the enumerated data set in JQuery DataTables. No error, simply "No data available in table" after initialization.

Data:

{
"odata.metadata":"http://localhost/blahblahblah/$metadata#SearchData","value":[
{"ShipmentKey":"12345"},
{"ShipmentKey":"12346"},
{"ShipmentKey":"12347"},
{"ShipmentKey":"12348"},
],"odata.nextLink":"http://localhost/blahblahblah/SearchData?$skip=100"
}

Columns init attempts:

"columns": [
{ "data": "value.ShipmentKey" },
]
and
"columns": [
{ "data": "value..ShipmentKey" },
]

Answers

  • andrewbaderaandrewbadera Posts: 2Questions: 1Answers: 0

    Ah I see, I needed to use dataSrc to specify "value" in my ajax setup.

This discussion has been closed.