通过浏览器F12我们发现,在菜单对应的dom元素上面,有几个系统附加的事件处理函数,只要我们将它去掉就可以了。示意代码如下:
{
xtype: "button",
scope: zhuUx,
menu: {
xtype: 'menu',
listeners: {
'show': function (me, eOpts) {
var cache;
var element = me.getEl();
var id = element.id;
var excludeEvents = ["mouseover", "mouseleave", "mouseenter"];
if (id && (cache = Ext.cache[id])) {
events = cache.events; for (eventName in events) {
if (events.hasOwnProperty(eventName)) {
if (Ext.Array.contains(excludeEvents, eventName)) {
Ext.EventManager.removeListener(element, eventName);
}
}
}
cache.events = {};
}
}
},
plain: true,
items: [zhuUx.yinhuanLuduanForm]
},
flex: 0,
width: 150,
scale: 'medium',
text: '隐患路线分段',
}