Hybrid View
-
7 Oct 2012 9:27 AM #1
Disable contextmenu on document but leave it for components
Disable contextmenu on document but leave it for components
ExtJs 4 is not a framework ... is a never-ending battle!

I won a battle:
This solution stop right click events on document browser but leave it for ExtJs ones.Code:Ext.onReady(function() {...Ext.application({... launch: function() {... Ext.getDoc().on('contextmenu', function(e,t,eOpts) { if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } return false; });
I can right-click on TreeMenuItems, panel desktop and so on.
ciao!
-
10 Oct 2012 8:04 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
There is an example of overriding the context menu examples/menu/action-grid.html
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
10 Oct 2012 10:58 PM #3
Thanks for your reply but my problem was to block right click at window browser level and leave it for components.
In the example action-grid.js if you click outside the grid the system context menu rise up and is not exactly what i need. So, after some googling i found a solution that works for my purpose.
diego
-
11 Oct 2012 3:24 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
Of course but that's just because that's where the listener is. There's not going to be an example for everything under the sun.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote