1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    21
    Vote Rating
    1
    DracisFL is on a distinguished road

      0  

    Default Multiple Controllers

    Multiple Controllers


    Hi All, I need some conceptual direction on this please.

    layout.png
    I have two controllers.. and all code/Views are fine independent of one another and function as I expect. Now suppose I create an event listener in controller 2 where I want it to perform some function in controller 1 or reference some view associated with controller 1.. I cannot seem to grab a reference for the life of me !! Is this even possible ? I would imagine it should be.. Help !! Thanks in advance.

    p.s. I did try this.getController() and this.getView() - but did not have any luck with that

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    From controller2 use this.getApplication().getController('controller1') and then if you have references(refs) setup in controller1 you should be able to get reference to a view
    Bharat Nagwani
    Sencha Designer Development Team

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    21
    Vote Rating
    1
    DracisFL is on a distinguished road

      0  

    Default


    Thanks bharatn,

    I'm getting this error

    Uncaught TypeError: Object [object Object] has no method 'getApplication'

    so I tried

    this.MyApp.getController('shipControl');

    since MyApp is the name of my Application..

    Uncaught TypeError: Cannot call method 'getController' of undefined

    and I tried several other variations..

    I'll look into it more tomorrow when I have time, probably something simple I am missing.

    Thanks again

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,182
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    getApplication() only works in Touch. Use .application in Ext.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    21
    Vote Rating
    1
    DracisFL is on a distinguished road

      0  

    Default


    Thanks aconran, that got me the reference to the other Controller

    var test = this.application.getController('shipControl');
    test.init();


    From here I was able to call a method in the other controller..

    Appreciate the help..

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi