Complex databinding

I can’t figure out how to do this and I’m not sure it is even do-able. Let’s say I have a json structure as follows (for arguments sake):
{
“nodes”: [
{
“key”: “0”,
“Name”: “Builders”
},
{
“key”: “1”,
“Name”: “Market”,
“Modifiers”: {
“Modifier”: [{“name”: “Income”, “value”: “+1”}]
}
}
],
“links”: [
{
“from”: “0”,
“to”: “1”
}
]
}

I have a panel with three text boxes. I can bind the name but I want to bind the Modifier name and modifier value to the next two (and obviously there can be an array of modifiers).

Is it possible to actually bind these or do I have to change the structure to flatten it out?

Thanks!

First, I hope you know about Panel.itemArray and Panel.itemTemplate (or Panel.itemTemplateMap):
http://gojs.net/latest/intro/itemArrays.html.

Given that capability, it would certainly be easier if you restructured your node data to be like:
{ “key”: “1”, “Name”: “Market”,
“Modifiers”: [{ “name”: “Income”, “value”: “+1” }]
}
Then your Binding could just be:
$(go.Panel, . . .,
new go.Binding(“itemArray”, “Modifiers”),
{ itemTemplate: . . . },
. . .
)

But you can leave the data the way it is by using a conversion function:
{ “key”: “1”, “Name”: “Market”,
“Modifiers”: {
“Modifier”: [{ “name”: “Income”, “value”: “+1” }]
}
}
and:
$(go.Panel, . . .,
new go.Binding(“itemArray”, “Modifiers”, function(m) { return m.Modifier; }),
{ itemTemplate: . . . },
. . .
)

Of course I found this about 2 seconds after I posted the question. Thanks Walter. I’ll modify the json - it’s easier and faster :)