Results 1 to 2 of 2

Thread: Best Practices for Listening to Events in Controllers?

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Location
    Raleigh, NC
    Posts
    17

    Default Answered: Best Practices for Listening to Events in Controllers?

    Can you please specify the best practices for setting up event listeners in Controllers? I have seen them added to the init() area, as well as the config() area. I have also seen things set up via listeners block. When do you use each technique?

    Also, I know you can listen for "application events" in the init(app) area of a Controller, but can you listen for Application events in the config area as well?

    Thanks
    -bclover

  2. For components, it is recommended to use the control config in the config object. For other things like application or store listeners you can place anywhere as there isn't a config to listen for them.

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    For components, it is recommended to use the control config in the config object. For other things like application or store listeners you can place anywhere as there isn't a config to listen for them.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Posting Permissions

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