PDA

View Full Version : combobox select-like



ci11111
1 Apr 2012, 3:30 AM
I have several inline select fields, last one is a multiselect combobox,

combobox and select looks differents (http://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/form/combos.html) so I have opted for using combovoxes with forceSelection: true,

I would also like to expand the combo on user click (on the text input)


listeners:{
focus: function(){
this.expand();
}
}

is not enough (if you click again it will be not expanded), click event doesn't exist it seems, any idea?
If it's not possible I will stay like this, and try to apply several css to make selects and my last multi-combo looks the same
thanks

scottmartin
11 Apr 2012, 6:00 AM
What version of ExtJS are you using? 4.07, 4.1? I added your listener to the example code in API docs and the combo opened on each click of input area.

Regards,
Scott.

ci11111
11 Apr 2012, 7:12 AM
4.07
Are you sure? click on the combo input, the list will expand, select one of the option, then reclick directly on the combo input again, there it will not expand


Ext.create('Ext.form.ComboBox', {
name : 'enumL',
emptyText : 'Lingua',
displayField : 'text',
selectOnFocus:true,
minChars: 1,
hideTrigger:true,
valueField : 'value',
store : Ext.create('Ext.data.Store', { fields : [ 'text', 'value' ],
data : [ {
'text' : 'italiano','value' : 1
}, {
'text' : 'francese','value' : 2
} ]
}),
listeners : {
focus: function(){ this.expand();}
}

scottmartin
11 Apr 2012, 7:40 AM
My mistake... I was leaving the control after each instance.. when you select the value and the cursor is in the input, onFocus will not trigger again until you leave the control. Let me check the code.