PDA

View Full Version : Button Menu menutriggerout/over



ody
6 Sep 2010, 6:31 AM
Hi, I'm attempting to display a menu when a user mouse overs a button, and when they mouseout the menu closes. However the moment you leave the button the menu closes which makes it impossible to get to the actual menu. I've tried the mouseover and mouseout events but they seem to have the same behaviour. Any help would be greatly appreciated. Example code:


var win = new Ext.Window({
xtype: 'window',
title: 'My Window',
width: 400,
height: 250,
tbar: {
xtype: 'toolbar',
items: [
{
xtype: 'button',
text: 'Menu',
menu: {
xtype: 'menu',
items: [
{
xtype: 'menuitem',
text: 'Item 1'
},
{
xtype: 'menuitem',
text: 'Item 2'
},
{
xtype: 'menuitem',
text: 'Item 3'
}
]
},
listeners : {
'menutriggerover' : function(btn) {
btn.showMenu();
},
'menutriggerout' : function(btn) {
btn.hideMenu();
}
}
}
]
}
}).show();

Condor
6 Sep 2010, 6:41 AM
Maybe this example (http://www.sencha.com/forum/showthread.php?76885-Button-menu-show-on-mouseover-and-hide-on-mouseout&p=371124#post371124) can help.