Tuesday, May 15, 2007

Ext Combobox - Typeahead and mode local

The Ext combobox has a 'mode' property that can be either 'remote' or 'local'. These terms are somewhat misleading. They should really be called something like 'manual load' and 'auto load'. A 'remote' mode combobox gets its data store's load method called behind the scenes. A 'local' mode combo requires an explicit data store 'load' call to get the store and combobox loaded up with data.

Meanwhile, it seems that the only way to get 'typeahead' to work in a combobox is if mode:local. I'd also recommend Trigger:all and I'm not sure why anyone would not want to Trigger:all. This causes the entire combobox dropdown to be listed when the user clicks the down arrow.

var cb = new fm.ComboBox({
typeAhead: true,
mode:'local',
store: dsdevice,
forceSelection: true,
triggerAction: 'all',
displayField: 'fld1',
valueField: 'fld2',
lazyRender:true,
editable:true
});

No comments: