我找了好久才找到的...之前在公司搞了一天多没有搞出来,回家给我找到了.......其实真的是对EXT的内核不了解.
this.el = Ext.getDoc('x-desktop');
var rightClick = new Ext.menu.Menu({
id: 'rightClickCont',
items: [
{
text: '菜单1',
},
{
text: '菜单2'
}
]
});
var desktopEl = this.el;
desktopEl.on("contextmenu", function(e) {
if (e.target.id == "x-desktop") {
e.stopEvent();
if (!this.rightClick.el) {
this.rightClick.render();
}
var xy = e.getXY();
this.rightClick.showAt(xy);
}
}, this);
来源:一起Ext
原文地址:http://www.17ext.com/showtopic-1501.aspx