PDA

View Full Version : Can't get type ahead to work on combobox with a store



sfwalter
16 Apr 2007, 8:23 AM
I have an editable grid and I am trying to get type ahead to work. I can get it to work if I create a select tag (make it hidden) in the html just like the editable grid demo.

However I would like to populate the combobox with a store. When I use a store for some reason type ahead doesn't work. Here is what I have:



var priorities = [
['Shade', 'Shade'],
['Mostly Shady', 'Mostly Shady'],
['Mostly Sunny', 'Mostly Sunny'],
['Sun or Shade', 'Sun or Shade'],
['Sunny', 'Sunny']
];

prioritiesStore = new Ext.data.SimpleStore(
{ id:0,
fields: ['name', 'description'],
data : priorities
}
);



and here is the definition of the combobox in my column model:



{ header: "Priority",
width: 50,
sortable: true,
align: 'center',
resizable: false,
locked:false,
dataIndex: 'priority',
//renderer: renderPriority,
editor:
new Ed(new fm.ComboBox(
{ typeAhead: true,
triggerAction: 'all',
lazyRender:true,
//transform:'light'
store:prioritiesStore,
displayField:'description',
valueField:'name'
}
)
)
},


Am I doing something wrong or could this possible be a defect? FYI I am using version 1.0

cheers,

scott

sfwalter
17 Apr 2007, 8:00 AM
anyone have any ideas?

sfwalter
17 Apr 2007, 8:48 AM
yeah I figured it out, thank gawd for firebug ;) If you are loading from a store then the "minChars" property is used. By default if you don't set it the value is 4.

Hope this helps others.