Hi, this is my json from server:
Code:
[
{
"consulta_id": 23752,
"convenio_id": 1,
"data": "2012-07-11",
"id": 36569,
"paciente": {
"nome": "Alvasole",
"id": 12
},
"tipo": 1
},
{
"consulta_id": 23753,
"convenio_id": 61,
"data": "2012-07-11",
"id": 36579,
"paciente": {
"nome": "Felintoi",
"id": 33
},
"tipo": 1
}
]
I need to bind the combobox to the field: paciente.id and paciente.nome, respectively to valueField and displayField.
This combo will only have 1 record on its store.
I get this work in this way:
Code:
this.getForm().loadRecord(rec);
combo.store = Ext.create('Ext.data.Store', {
fields: ['id', 'nome'],
data : [
rec.get('paciente')
]
});
But i think that may have a better way.