PDA

View Full Version : Nested Json tree panel, mapping?



JeroenR
17 Nov 2014, 3:26 AM
So i have a nested complex json string that looks like this:


{
"id":"201",
"date":"2012-10-10 13:52:13.528219",
"Extends":[
{
"object1":{
"id":"201",
"date":"2012-09-03 12:48:20.761162"
"extends":[
{
"object2":{
"object_id":"201",
}]
}
]}


I deleted some of the json, but you can assume the structure is the same.

Now i want to display this in a treepanel, so for instance:

the tree has to display the id and the date of the root, then there is a leaf named object1 with other attributes. That leaf has another leaf with object2 and so on.

Can anyone give me a push in the right direction how to do this?

slemmon
18 Nov 2014, 4:18 PM
Do you have access to modify the source data (JSON)?

JeroenR
19 Nov 2014, 3:19 AM
Yes i a have, but my boss recommends that i don't modify the JSON

slemmon
19 Nov 2014, 10:30 AM
Can you post a full JSON response just so we know for sure what we're working with? Want to make sure I'm leading you down the right path since the JSON is not likely to change.