I want to load json data into form.
my json :
{
"success": "true",
"data": {
"operation[id]": "1199",
"operation[startdate]": "2011-10-04 08:00:00",
"operation[starthour]": "08:00",
"operation[enddate]": "2011-10-04 18:00:00",
"operation[endhour]": "18:00",
"operation[year]": "2011",
"operation[abscomment]": "",
"operation[person_id]": "13",
"operation[Mission]": {
"id": "1",
"operation_id": "1199",
"subject": null
}
}
}
It works with key like operation[id] but not with operation[Mission][id].
In my form :
{
xtype: 'textfield',
fieldLabel: 'Subject',
name:'operation[Mission][subject]',
anchor: '50%',
margin: '15 10 5 10',
allowBlank: false,
blankText:'required'
},
For operation[Mission][id] to be valid, you’d have to change your JSON structure and remove some of the nesting. The name is just a string identifier, you can’t use it to express how to get data from a nested JSON structure.