1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    grn2012 is on a distinguished road

      0  

    Exclamation Unanswered: Event Controllers Don't Exist for Certain Components?

    Unanswered: 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,524
    Vote Rating
    873
    Answers
    3563
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    Nov 2011
    Posts
    3
    Vote Rating
    0
    grn2012 is on a distinguished road

      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
    grn2012 is on a distinguished road

      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?

Thread Participants: 1

Tags for this Thread