87,921
社区成员
发帖
与我相关
我的任务
分享
Ext.override(Ext.menu.BaseItem,{
// private
activate : function(){
if(this.disabled){
return false;
}
var li = this.container;
li.addClass(this.activeClass);
//注释掉,这一行代码会触发mouseover展开sub menu的事件。
//this.region = li.getRegion().adjust(2, 2, -2, -2);
this.fireEvent("activate", this);
return true;
},
// private
handleClick : function(e){
if(this.hideOnClick){
//点击menu本身不关闭menu
// this.parentMenu.hide.defer(this.hideDelay, this.parentMenu, [true]);
}
}
})
Ext.override(Ext.menu.Item,{
// private
handleClick : function(e){
if(!this.href){ // if no link defined, stop the event automatically
e.stopEvent();
}
//改成点击展开
this.expandMenu();
//Ext.menu.Item.superclass.handleClick.apply(this, arguments);
},
// private
activate : function(autoExpand){
if(Ext.menu.Item.superclass.activate.apply(this, arguments)){
this.focus();
if(autoExpand){
//注释mouseover就展开submenu的调用
//this.expandMenu();
}
}
return true;
}
})
Ext.onReady(function(){
//menu实例化。。
})