PDA

View Full Version : Right click still opens browser's default menu



ahsec
22 May 2012, 6:09 AM
how do I override the browser's right click menu??
I've tried

Ext.getCmp('a_alertsTable').addListener(
'itemcontextmenu',
function(that,record,index,eOPts){


}
);


but it does both my function (I'm opening a menu) and opens the right click menu of the browser...

how do I avoid the latter??

Thanks

sword-it
22 May 2012, 6:34 AM
Hi,
If you don't want to see the browsers context menu, then you just need to add one attribute to the body tag of your html/aspx page. Like following:


<body oncontextmenu="return false;">

</body>


Regards

ahsec
22 May 2012, 6:37 AM
If I get you right.. it will disable ALL right clicks...no matter what area I click on...

I want to disable the browser's only where I declared a function to override it....

sword-it
22 May 2012, 6:47 AM
Try this:




Ext.getCmp('a_alertsTable').addListener('itemcontextmenu',function(that,record,index,eOPts){
eOPts.preventDefault();
});