1. #1
    Sencha User interfasys's Avatar
    Join Date
    Mar 2011
    Location
    UK & Switzerland
    Posts
    125
    Vote Rating
    1
    interfasys is on a distinguished road

      0  

    Default Answered: Is there a way to fire a controller event straight from a listener?

    Answered: Is there a way to fire a controller event straight from a listener?


    Is there a way to do something like this:
    Code:
    button.on(
                    'tap',
                    MyApp.app.fireAction('doSomething'), // This does not work
                    MyApp.app
                );
    The above code fires the event instead of adding the listener.

    The reason to do this is to avoid having to create a private method just to fire the event.
    Olivier - interfaSys
    Developing custom solutions for BlackBerry 10 using Sencha Touch.

  2. PHP Code:
    button.on(
                    
    'tap',
                     function() {
                               
    MyApp.app.fireAction('doSomething'), // This does work
                    
    }
                ); 

  3. #2
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    619
    Vote Rating
    29
    Answers
    67
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      1  

    Default


    PHP Code:
    button.on(
                    
    'tap',
                     function() {
                               
    MyApp.app.fireAction('doSomething'), // This does work
                    
    }
                ); 
    Latest thoughts on the subject: http://joy2share.com/senchatouch/

  4. #3
    Sencha User interfasys's Avatar
    Join Date
    Mar 2011
    Location
    UK & Switzerland
    Posts
    125
    Vote Rating
    1
    interfasys is on a distinguished road

      0  

    Default


    It does indeed! I didn't think of using a wrapper, thanks!
    Olivier - interfaSys
    Developing custom solutions for BlackBerry 10 using Sencha Touch.

Thread Participants: 1