View Full Version : How to reset a Combobox or Multiselect to no values selected

26 Mar 2012, 5:58 AM
I tried for example putting a field with an empty string value, put it's rendered with a tiny row, hard to click


26 Mar 2012, 7:45 AM
Is this what you want?


26 Mar 2012, 8:22 AM
would be cool to have clear icon in textfield and combobox, like Sencha Touch

26 Mar 2012, 9:24 AM
You can configure one for a combobox. Something like this:

Ext.create('Ext.form.field.ComboBox', {
trigger1Cls: 'x-form-clear-trigger',
trigger2Cls: 'x-form-arrow-trigger',

onTrigger1Click: function() {

If you want one for a textfield then use a triggerfield with a clear trigger.

26 Mar 2012, 9:52 AM
how to do you do, so it's not visible at startup,
visible only if the field is dirty

26 Mar 2012, 9:59 AM
Off the top of my head, try using CSS to hide/show the trigger using suitable listeners on the combobox.

27 Mar 2012, 2:49 AM
another thing, How you do it on a multiselect, I have tried your solution
it seems possible to apply a clear icon, there is clearCls in the doc, but I don't know how

27 Mar 2012, 3:59 AM
clearCls has nothing to do with putting in a clear trigger, it's part of the inner working of fields and I'm not really sure why it's documented.

What exactly do you mean by a multiselect? It might help if you posted some sample code.

27 Mar 2012, 4:12 AM
I would like to customize this comp
to be able to clear all values if I click on a single selection, or having a clear icon on the right of that field. need to choose one of the possible feature among those 2

To me, it would be better than having a big button 'Reset fields'

well let me open another thread, where I explain it, this 1 is solved