Results 1 to 4 of 4

Thread: Disable contextmenu on document but leave it for components

  1. #1
    Sencha User
    Join Date
    Apr 2010
    Location
    Bologna, Italy
    Posts
    47
    Vote Rating
    2
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,413
    Vote Rating
    1269
      0  

    Default

    There is an example of overriding the context menu examples/menu/action-grid.html
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    Bologna, Italy
    Posts
    47
    Vote Rating
    2
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,413
    Vote Rating
    1269
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •