Search code examples
inputextjscomboboxexpand

Clearing ExtJS combobox input field


I have an Ext.form.ComboBox with the following properties:

fieldLabel: 'Regiune',
valueField: 'id',
displayField: 'reg',
id: 'cbRegR',
typeAhead: true,
store: new Ext.data.JsonStore({...}),
mode: 'local',
emptyText: '',
listeners:{...}

The problem is that I have to manually delete the combobox' input field after selecting a value from the dropdown list to view all the list items. The matter is the list displays only the items that begin with letters in input field.

How can I clear the input field on expanding dropdown list? I tried the following but it doesn't work:

listeners: { 'expand': function() { cbRegR.clearValue(); } }

Seems to be easy but it ain't so for me.. Any bright ideas? Thanks in advance.


Solution

  • Adding the config property to your combobox

    triggerAction: 'all'
    

    might do the trick, without the need to register an expand event handler or clearing the combobox's value