If JSON result is an array with numbered keys, it says "No data available in table"
If JSON result is an array with numbered keys, it says "No data available in table"
princeofnaxos
Posts: 26Questions: 9Answers: 0
Using ajax to retrieve the data for the table, I get an object with numbered keys, e.g.
{ "12" : { "amount" : "34" }, "15" : { "amount" : "36" } }
With this, no data is displayed in the table. Why?
Is there another way I can display this data?
This discussion has been closed.
Answers
As the manual notes:
You can have objects in that array as the documentation goes on to explain, but there must be an array of entries, with one entry per row.
You'd need to convert your object to an array. That could be done with $.map or similar.
Allan