nested array problem json values in same column and row
nested array problem json values in same column and row
I am trying to list all items into the table.
json structure {
"items": [
{"name": "Gelatine Leaves - Bulk",
"id": 1,
"timestamp": "2017-08-12 01:07:22",
"price": 7.08}
]
"username": "Oralla",
"user_id": 4
}
Problem is that values like name are in the same column. Every item should be in their own row.
Can some give some hint what should I be doing?
picture of problem
code
Live example
http://live.datatables.net/yaqirime/4/edit
This question has an accepted answers - jump to answer
Answers
I modified your data format, example here:
http://live.datatables.net/qejoyupo/1/edit
Not sure this is what you are looking for but your
data
variable was an array with your data duplicated multiple times. I removed the array and duplicated data. So now the structure looks like this:Then I changed your
data
andoption columns.data
config to this:Now the table populates as expected.
Kevin