PDA

View Full Version : Combo: auto select by first letter



Clever Cutter
28 Jan 2010, 5:13 AM
On normal HTML drop downs, a states combo for example, when you type the letter 'F' the list would jump to Florida. I have a number of ExtJS combos on a page and this behavior does not appear to work. Is there a setting I need to specify for it to work? Here is an example of one of my combos:



Combo_FormRMVCompOpts = Ext.extend(Ext.form.ComboBox, {
constructor: function(config) {
Ext.apply(this, {
store: new Ext.data.SimpleStore({
fields: ['opts'],
data : [
['Age'],
['Basement Finished'],
['Basement Unfinished'],
['Construction Quality'],
['Design Appeal'],
['Fireplace'],
['Functional Utility'],
['Garage / Bays'],
['Heating / Cooling'],
['Location'],
['Market Conditions'],
['Miscellaneous'],
['Pool Type / Spa'],
['Porch / Patio / Deck'],
['Seller Concessions'],
['View'],
['Water Supply / Septic']
]
}),
displayField:'opts',
valueField:'opts',
forceSelection: true,
editable:false,
triggerAction: 'all',
mode: 'local',
selectOnFocus:true
});

Combo_FormRMVCompOpts.superclass.constructor.apply(this, arguments);
}
});
Ext.reg('combormvcmpopts', Combo_FormRMVCompOpts);

Clever Cutter
28 Jan 2010, 6:09 AM
I got this working. I discovered that I need to make the field editable for this behavior to work. This along with forceSelection: true looks to be the solution.