Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SmartTable (React) - Rendering nested data #371

Unanswered
airowe asked this question in Q&A
Discussion options

I don't see anything in the docs showing how to render nested JSON Data in a CSmartTable. Any suggestions on how to achieve?

I want to display three groups with the last group having three child fields each in their own columns. Here's an example bit of the data:

{ "who": "Dr. Adam Rowe", "when": "2023-08-07 09:46:03 -0700", "what": [ { "key": "animal_name", "from": null, "to": "Dog" }, { "key": "breed", "from": null, "to": "Lab" }, { "key": "end_time", "from": null, "to": "2023-08-07 09:45:00 -0700" }, { "key": "start_time", "from": null, "to": "2023-08-07 09:30:00 -0700" } ] }

Here's my current columns definition:

[ { group: 'Who', key: 'who_group', children: [ { key: 'who', label: '', _style: { width: '20%' } } ] }, { group: 'When', key: 'when_group', children: [ { key: 'when', label: '', _style: { width: '20%' } } ] }, { group: 'What', key: 'what_group', children: [ { key: 'key', label: 'Field' }, { key: 'from', label: 'From' }, { key: 'to', label: 'To' } ] } ]}

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /