In Ext.tree.Panelthere are events itemcontextmenuand containercontextmenu.
Update: The same events exist for Ext.grid.Panel. You probably want to subscribe to them and do something like this:
showContextMenu: function(e) {
var me = this;
if (me.contextMenu === undefined)
return;
e.stopEvent();
me.contextMenu.showAt(e.getXY());
},
gridContextMenu: function(view, rec, node, index, e) {
this.showContextMenu(e);
},
containerContextMenu: function(view, e) {
this.showContextMenu(e);
},
source
share