Nested json question
Nested json question
gunnargj
Posts: 1Questions: 1Answers: 0
Hi
I have nested json like this.
Can the result in the table be:
2019, Item 1, 89929
2019, Item 2, 5414
I only get the year once with this code and nothing for the children:
"columns": [
{ "data": "date" },
{ "data": "root.name"},
{ "data": "root.count"},
],
This discussion has been closed.
Answers
Datatables expects each row to be it's own array element. For each root element to have tis own row your data structure would need to look more like this:
More info can be found here:
https://datatables.net/manual/data/#Data-source-types
Kevin