PDA

View Full Version : unselect the first option for combobox when onfocus?



kohyea
23 Feb 2009, 12:41 PM
I have created a combobox:

var combo = new Ext.form.ComboBox({});

when I call the focus event: combo.el.focus() , it will select the first option and show the pop up, how could I disable it?

thanks.

tryanDLS
23 Feb 2009, 1:18 PM
Why are you calling focus on the el, rather than directly on the field, with the optional select flag?

kohyea
23 Feb 2009, 1:24 PM
Hi, thanks for your quick reply, I wanna the cursor go to the combobox, do you have any suggestion?

kohyea
23 Feb 2009, 2:01 PM
I tried to set focus directly to the combobox: combo.onFocus();

but it product the same problem.

tryanDLS
23 Feb 2009, 2:22 PM
There is no public method called onFocus.

What happens when you use http://extjs.com/deploy/dev/docs/?class=Ext.form.ComboBox&member=focus

kohyea
23 Feb 2009, 2:31 PM
ok, thank you, last I found a way to fix it.:D