Results 1 to 4 of 4

Thread: Event Controllers Don't Exist for Certain Components?

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
      0  

    Exclamation Event Controllers Don't Exist for Certain Components?

    I have everything properly set up to handle events for my main menu. For some reason, inside the init function of my controller, mouseover only works for menus, not their items. I've tried everything and I just can't seem to get it working. Are they supposed to have this event? Here is my controller code:

    Code:
    Ext.define('Agile.controller.Main', {
        
        extend: 'Ext.app.Controller',
        
        views: ['ui.Container'],
        
        init: function() {
            
            this.control( {
                
                'menu > menuitem': {
                    
                    click: this.onClick,
                    
                },
                
                'syntax': {
                    
                    mouseover: this.onMouseOver
                    
                }
            
            } );
            
        },
        
        onClick: function(objBtn, objMenu, objOptions) {
            
            console.log('click fired')
            
            strID = objBtn.id;
            
            switch (objBtn.id) {
                
                case "syntax":
                    
                    // Need the mouseover event to fire here to eliminate redundancy.  Syntax
                    // is a child menu, just toe explain.
                    
                    console.log('syntax wee');
                    
                    break;
                
            }
            
        },
        
        onMouseOver: function(objBtn) {
            
            console.log('mouseover fired')
            console.log(objBtn)
            
            refreshViewSettings();
            
        }
        
    } );

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    If your ComponentQuery selector can return a Component then any of it's events can be listened to in your Controller. I'm assuming your click handler works as I just tested it and it worked for me. Your mouseover will not work because there is no mouseover event listed for the Ext.menu.Item.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    If your ComponentQuery selector can return a Component then any of it's events can be listened to in your Controller. I'm assuming your click handler works as I just tested it and it worked for me. Your mouseover will not work because there is no mouseover event listed for the Ext.menu.Item.
    Is there a way to find out what item in the menu I'm hovering over or is there an event where a menu opens? I just need to know when a certain menu opens up.

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Is there a way to have all menus exist initially in the DOM but have their visibility set to hidden like how it is later when they're not active?

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
  •