Results 1 to 3 of 3

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

  1. #1
    Sencha User interfasys's Avatar
    Join Date
    Mar 2011
    Location
    UK & Switzerland
    Posts
    125
    Vote Rating
    1
      0  

    Default 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
    623
    Answers
    67
    Vote Rating
    29
      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
      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.

Posting Permissions

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