当鼠标移开ext.toolbar.button与ext.menu.Menu这两块区域时隐藏Menu。
EXT不熟练,困扰2天了。麻烦各位高人帮帮忙,非常感谢Ext.onReady(function(){
Ext.QuickTips.init();
var menu = new Ext.menu.Menu({
id: 'mainMenu',
style: {
overflow: 'visible' // For the Combo popup
},
items: [{
text: 'AAA',
},
{
text: 'BBB',
}
]
});
var tb = new Ext.Toolbar();
tb.render('toolbar'); tb.add({
text:'Button w/ Menu',
iconCls: 'bmenu', // <-- icon
menu: menu // assign menu by instance
,
listeners : {
mouseover : function (obj,e) {
if(!obj.menu.isVisible()){
obj.showMenu();
}
}
}
});
tb.doLayout();
});
EXT不熟练,困扰2天了。麻烦各位高人帮帮忙,非常感谢Ext.onReady(function(){
Ext.QuickTips.init();
var menu = new Ext.menu.Menu({
id: 'mainMenu',
style: {
overflow: 'visible' // For the Combo popup
},
items: [{
text: 'AAA',
},
{
text: 'BBB',
}
]
});
var tb = new Ext.Toolbar();
tb.render('toolbar'); tb.add({
text:'Button w/ Menu',
iconCls: 'bmenu', // <-- icon
menu: menu // assign menu by instance
,
listeners : {
mouseover : function (obj,e) {
if(!obj.menu.isVisible()){
obj.showMenu();
}
}
}
});
tb.doLayout();
});
设置MENU的VISIBLE不行吗
其实这个效果肯定就是mouseout和mouseover这俩事件来处理了
但这个有点特殊 因为你的menu在toobar下边 tbar onmouseout隐藏menu的话 向下一离开tbar menu就隐藏了
用户甚至都选不上AAA和BBB了