TCH TCH - 10 days ago 5
Javascript Question

Ext JS Combobox inside button menu doesn't keep focus

I recently deal with a focus problem when I'm typing in a combobox (which is in a button menu) and that my mouse is moving out of the field, then I loose the focus on it and cannot type anymore.
This does not come from the combobox itself because if I create one on the window it works well.
I'm using Ext js 4.1.3 and I'm wondering if there is a workaround or an alternative to create such component.
some code :

Ext.define('xxxxx.SaveOptionsButton', {
extend: 'Ext.button.Button'
,alias : 'widget.saveOptionsButton'
,constructor : function(config) {
var me = this;
me.menu = Ext.create('Ext.menu.Menu',
{
showSeparator:false
,frame:true
,items: [
{
xtype: 'checkboxgroup'
,items: [
{
xtype:'checkbox'
,name:'save'
,checked: true
}
,
{
xtype:'combo'
,name: 'myComboName'
,queryMode:'local'
}
]
}]
});
}
}


Thanks !

TCH TCH
Answer

Solved it adding :

,listeners: {
     mouseover : function (menu, item, e, eOpts) {
     //fix bug of loosing focus on combo


     menu.down("combo[name=shipmentTemplates2]").focus();
         }
}