I`m having problems setting up a context menu on the Ext.Viewport.
When I use the code below, the context menu appears even if I right click on an Ext.Window
Is this down to the scope on the onclick?
Or do I need to setup a condition in the onContextMenu function, if viewport clicked then show context menu?
Code:
var bgBody = new Ext.Viewport({
id:'bgBody',
margins: '5 5 5 0',
layout:'fit',
items: iconDisplay
});
//set on right click show context menu
Ext.getCmp('bgBody').getEl().on('contextmenu', onContextMenu);
//Ext.getBody().on('contextmenu', onContextMenu);
function onContextMenu(e, target) {
e.preventDefault();
messageContextMenu.showAt(e.getXY());
}