Results 1 to 2 of 2

Thread: multi controllers problem

  1. #1
    Sencha User
    Join Date
    Oct 2010

    Default multi controllers problem

    in my application, there are many views, i define a controller for each view. i encounter a problem that is how to communicate between two controllers. for example, i want to send a message in one controller to another controller to trigger a event. how to do???


  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL


    I wouldn't create one controller per view... seems like a lot of classes floating out there. Instead, I have one controller per feature in my apps.

    You can get another controller by using the getController method that is on each controller. Then you can execute a method on that controller but remember about scoping issues.

    A more flexible way to do things is to fire events on the application and the controllers listen to events on the application. So if one controller needs to fire an event that other controllers can listen to, the application can be the middle man.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:

    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