Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    18
    Vote Rating
    0
    jiancha is on a distinguished road

      0  

    Default config listeners not working

    config listeners not working


    Hello,

    here is test code:

    Code:
    Ext.application({
        launch : function() {
            var b = Ext.create('Ext.Button',{
                text : 'Btn',
                id: 'btn1',
                centered: true,
                fullscreen: true,
                renderTo : Ext.getBody(),
                width: 70,
                height: 70,
                
                listeners: {
                    click : function() {
                        alert('I was clicked in listeners!');
                    },// not working
                    
                    mouseover: function() {
                        alert('mouseover in listeners 2!');    
                    }// not working either
                }                    
        });    
           /* 
            Ext.getCmp('btn1').getEl().on('mouseover', function(){
                alert('I am mousseovered in on');
            });//It works fine
             */  
        }
    });
    is that a bug ?

    Thank you !
    best regards !

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,581
    Vote Rating
    433
    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


    What happens when you instantiate the class and pass in the listeners there? Now the ones in the config Object will be overwritten. I would use the on method within constructor or initialize.
    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 - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,156
    Vote Rating
    3
    rdougan is on a distinguished road

      0  

    Default


    There is no such thing as 'mouseover', 'click' and other desktop events. Available element events can be found in the Kitchen Sink > Touch Events example: http://docs.sencha.com/touch/2-0/tou...ink/index.html
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.