Hi All,
when i move out a mouse from a menu, this not disappear; it do it only if i click outside the menu or if i open another menu.
I try to use onmouseout event on menu, but it is invoked for all items child and not when the mouse exit from the menu (that is container of all items) such as is write in Menu.js: /**
* @event mouseout
* Fires when the mouse exits this menu
* @param {Ext.menu.Menu} this
* @param {Ext.EventObject} e
* @param {Ext.menu.Item} menuItem The menu item that was clicked
*/ Can someone help me?
Thanks in advance
Hi,
i solved in this way:
i define this function function hideMenu(menu){
try{
if (!menu.activeItem){
menu.hide();
}
} catch (e){}
}
and then i isnert this event on my menu ,listeners:{
mouseout : function (_this, eventObject, menuItem){
setTimeout(function(){hideMenu(_this)},10);
}
}
and work fine.
The solution that i indicated doesn't work when in a menu there is a separator becouse the activeItem ther isn't, so i worked around the problem in this way: function hideMenu(menu){
try{
if(menu.hideM){
menu.hide();
}
} catch (e){}
}
Ext.override(Ext.menu.Menu, {
hideM:false,
onMouseOver : function(e){
var t;
if(t = this.findTargetItem(e)){
if(t.canActivate && !t.disabled){
this.setActiveItem(t, true);
}
}
this.hideM=false;
this.fireEvent("mouseover", this, e, t);
}
,onMouseOut : function(e){
var t;
if(t = this.findTargetItem(e)){
if(t == this.activeItem && t.shouldDeactivate(e)){
this.activeItem.deactivate();
delete this.activeItem;
}
}
this.hideM=true;
this.fireEvent("mouseout", this, e, t);
}
}
)