PDA

View Full Version : Disable filtering on ComboBox



GoneIn20Seconds
29 Sep 2009, 6:02 AM
Does anyone know how to disable filtering on the ComboBox? I have a short list of items that I want the user to select from, but once they make a selection then all other selections are hidden. (The user cannot change their selection.) I assume that this is due to a text filter that gets applied to the array store that provides the data.

I thought that "disableKeyFilter: true" would fix the problem but it evidently is not doing what I expect.

Here is a piece of my code. The ComboBox is one of the items inside a Toolbar which is the toolbar for a GridPanel.




tbar: new Ext.Toolbar({
items: [{
xtype: "tbtext",
text: "Text: "
}, new Ext.form.ComboBox({
typeAhead: false,
mode: "local",
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ["value", "modifier"],
data: [[1, "A"], [2, "B"], [3, "C"], [4, "D"], [5, "E"], [6, "F"], [7, "G"], [8, "H"], [9, "I"]]
}),
valueField: "value",
displayField: "modifier"
})]
})

BitPoet
29 Sep 2009, 6:14 AM
Set triggerAction: 'all' (see the docs (http://www.extjs.com/deploy/ext-3.0.0/docs/?class=Ext.form.ComboBox&member=triggerAction))

GoneIn20Seconds
29 Sep 2009, 6:18 AM
Perfect. That was exactly what I was looking for. Thanks for the help.