Hiya,
Previously in Designer, if I sent a json structure that looked like this via a Model load (REST type)
Code:
{key1: {advertiserId: 2, ...}, key2: {someOtherId: 1, ...}}
I could then setup a model by hand and the fields could be specified as 'key1.advertiserId', or 'key2.someOtherId'. In the form, I would have the same nested names associated to specific fields. When loaded, the nested values would pre-fill the form, which was awesome.
With Architect, I am unable to create a Model field name in the same way. I do have access to the data I need in the raw property, and can set the Model values using this, but that seems like an odd way to handle the problem. Is there a way using Architect that I can create my model names to read the nested structures?
So, instead of this (cut from Architect)
Code:
Ext.define('CampaignManager.model.CampaignModel', {
extend: 'Ext.data.Model',
fields: [
{
name: 'advertiserId',
type: 'int'
},
{
name: 'someOtherId',
type: 'int'
}
]
});
I'd like to do this (to match my
Code:
Ext.define('CampaignManager.model.CampaignModel', {
extend: 'Ext.data.Model',
fields: [
{
name: 'key1.advertiserId',
type: 'int'
},
{
name: 'key2.someOtherId',
type: 'int'
}
]
});
If that isn't possible, what are my options? Is an override useful here? Create multiple models as use associates?
Thanks,
Thanatos