jtiai
23 Aug 2011, 10:29 PM
I would like to create a form that can be used to edit hierarchical data.
If I have for example following data:
{ "name" : "foo",
"somedata" : 123,
"extrainfo" : {
"name" : "bar",
"otherdata": 888
}
}
And I would like to have a form that contains fields for: "name", "somedata", "extrainfo.name" and "extrainfo.otherdata". And preferably so that I can set/get values by using loadRecord and getRecord methods on a form.
Closest thing I managed to make was to add fields as "extrainfo.name" (exactly like that) in the mian model but that kind of destroys the idea of using two models with properly set relation(s).
If I have for example following data:
{ "name" : "foo",
"somedata" : 123,
"extrainfo" : {
"name" : "bar",
"otherdata": 888
}
}
And I would like to have a form that contains fields for: "name", "somedata", "extrainfo.name" and "extrainfo.otherdata". And preferably so that I can set/get values by using loadRecord and getRecord methods on a form.
Closest thing I managed to make was to add fields as "extrainfo.name" (exactly like that) in the mian model but that kind of destroys the idea of using two models with properly set relation(s).