Hi All, I need some conceptual direction on this please.
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
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
I'm getting this error
Uncaught TypeError: Object [object Object] has no method 'getApplication'
so I tried
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.
getApplication() only works in Touch. Use .application in Ext.
Thanks aconran, that got me the reference to the other Controller
var test = this.application.getController('shipControl');
From here I was able to call a method in the other controller..
Appreciate the help..