1. #1
    Sencha User
    Join Date
    Apr 2010
    Location
    Bologna, Italy
    Posts
    32
    Vote Rating
    0
    dcima is on a distinguished road

      0  

    Default 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:

    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; });
    This solution stop right click events on document browser but leave it for ExtJs ones.

    I can right-click on TreeMenuItems, panel desktop and so on.

    ciao!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,121
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    Bologna, Italy
    Posts
    32
    Vote Rating
    0
    dcima is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    There is an example of overriding the context menu examples/menu/action-grid.html
    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

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,121
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

Tags for this Thread