I have the following code:
// Part of a larger form.
{
xtype: 'combo',
id: 'enroller',
valueNotFoundText: 'not found',
triggerAction: 'all',
mode: 'local',
fieldLabel: 'Enroller',
store: new Ext.data.JsonStore({
url: url,
root: 'data',
autoLoad: true,
fields: ['enrollerID', 'name', 'key']
}),
displayField: 'name',
valueField: 'key',
hiddenName: 'enrollerID',
forceSelection: true
}
// Other area of code.
Ext.getCmp('enroller').setValue(289);
Even though I can confirm the store has a record that looks like:
{"name":"Test Enroller","enrollerID":"289","key":"289"}
The combo box displays the valueNotFoundText. How can I get the combo to load the correct record?