Hello ,I have question regarding the data that I can pass as settings to the hot table ?
I got array of objects like { name: 'my-salad', status: 'salad', components: [ { tomato: 1, cucumber: 2 } ] }
I would like to have as table
name | status | tomato | cucumber
my salad | salad | 1 | 2
how to pass the data and columns to achieve that ?
Yes, I would like to have first two keys of my object as columns and also column for each component. is that possible ?
I get the whole data as one object and the pass it like ....updateSettings({ data: myData, columns: [ {data: name}, {data: status}, {data: components} ] })
from these 3 keys I would like to get 4 columns
The technique to achieve this goal is the same as previously mentioned - but colHeaders accept 1D array [number, string] so you can extract those values from your object. Example https://jsfiddle.net/AMBudnik/aotqhmd4/
Thank you for you quick responses!
No, I don’t mean the headers. I have nested array in my object like you got address in you fiddle.
I would like to create table like this one
Is this possible with data like var data = [ { id: 1345, name: 'Adam', address: [{state: 'CA'}, {state: CA}]}, { id: 2353, name: 'Tom', address: [{state: 'NY'}, {state: 'NY'}]}, { id: 3353, name: 'Maria', address: [{state: 'CA'}, {state: 'CA'}]} ]