PDA

View Full Version : How to prevent typing in a combobox



valfumble
27 Jan 2011, 9:37 AM
I want to prevent the users from typing in any text..

valfumble
27 Jan 2011, 9:40 AM
it is 'editable' property duh....

ken_opp
30 Mar 2011, 6:58 AM
The problem with "editable: false" is it disables the ability to use the keyboard to find an entry in the dropdown.

Just to be clear, I have a dropdown with about 50 entires. I don't want the user to be able to add an entry by typing in the combobox, however, I do want the user to pick an entry using the keyboard. A good example would be a list of states.

tvanzoelen
30 Mar 2011, 7:12 AM
disableKeyFilter: true

ken_opp
30 Mar 2011, 7:34 AM
disableKeyFilter: true or false doesn't seem to do anything. Here's what I have:

xtype: 'combo',
fieldLabel: 'Status',
triggerAction: 'all',
typeAhead: false,
id: 'cboSearchStatusId',
hiddenName: 'cboSearchStatusValue',
displayField: 'Name',
valueField: 'TicketStatusId',
store: storeSearchStatus,
mode: 'local',
editable: false,
disableKeyFilter: false

legrego
30 Mar 2011, 7:49 AM
try setting forceSelection : true

ken_opp
30 Mar 2011, 8:07 AM
forceSelection: true gets me a little closer, but it doesn't work with editable: false. With editable and forceSelection both true, the behavior is the user can type anything into the dropdown, but if it doesn't match a value in the dropdown it's ignored reverting back to the perviously selected value.

Also, the type ahead is goofy. As you type, it looks like it's picking the entry, but if you tab off of it, it reverts back. And if you hit enter, the entry is selected, but the default button is also clicked.