PDA

View Full Version : I want to disable the default context menu that comes by right clicking on browser



baswanth
21 Jul 2007, 11:47 PM
Hi,

I am new to the Ext library. As part of my works, i want to disable the default context menu that appears when we right click on the browser window.

Please give me a solution as i need it as soon as possible.

Thaks in advance.

Expecting repliest at the earliest!

Regards,
K.Baswanth Rao.

quilleashm
22 Jul 2007, 2:54 AM
I haven't tried this but attaching the contextmenu event to the document. e.preventDefault() stops the default event action from working.



Ext.get( 'document' ).on( 'contextmenu', function( e ){ e.preventDefault() ;} );


And you should really post this sort of question in the 'Help' forum.

evant
22 Jul 2007, 3:37 AM
To be slightly more complete:



Ext.get(document.body).on('contextmenu', function(e)
{
e.stopEvent();
}
);

baswanth
22 Jul 2007, 10:21 PM
Hi,

Thanks for your support. It is really working well.

Regards,
K.Baswanth Rao.