}, {
'xtype' : 'citycombo',
'name' : 'city',
'fieldLabel' : 'city',
listeners : {
"select" : function(k, rs) {
console.log("%o %o", k, rs);
if (rs.length) {
me.getComponent('iState').setValue(rs[0].get('state'));
}
}
},
}, {
'xtype' : 'textfield',
'id' : 'iState',
'name' : 'state',
'fieldLabel' : 'state',
},
Rants and ravings of a semi-autistic developer who has a hard time remembering idiotic nonsense details. Why remember it, when you know where to find it.
Wednesday, July 3, 2013
Wiring a combo box populating two fields by means of events.
We have a 'citycombo' with store attached that has a record with the name and the state where the city resides. For example:
name : 'Springfield', state : 'MA'.
The selection of Springfield, MA from the city combo will populate the state field (which is freeform). How to wire the events.
Flow; catch the select event, lookup the state field by means of its id 'stateId' and set the value of the field found....
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment