-
26 Aug 2012 6:57 PM #1
Answered: Calling a function on the application class from a controller
Answered: Calling a function on the application class from a controller
I want to call a function on my main application class on a controller
I have tried
MyAppName.app.fuctionName();
and
MyAppName.app..getApplication().fuctionName();
Both give me the error
Uncaught TypeError: Cannot read property 'id' of undefined
AbstractMixedCollection.js:135
However when I trace the application via
console.log(MyAppName.app);
The application class is in the console and I can see my function as part of the class.
Any ideas? or a better way to have a controller call a function on the application class?
-
Best Answer Posted by deliriousrhino
I have gotten around the problem by listening for an event from the controller in the application
this.getController('ControllerName').on(....)
Which is probably the better way.
Still would not mind to know why the call to the application function failed
-
26 Aug 2012 7:01 PM #2
I have gotten around the problem by listening for an event from the controller in the application
this.getController('ControllerName').on(....)
Which is probably the better way.
Still would not mind to know why the call to the application function failed
-
26 Aug 2012 7:04 PM #3
Was an error in my function the above code to call a function from a controller will work
-
14 Sep 2012 2:07 AM #4
I receive the same exception while executing this code:
Code:this.getListCategories().select(3);


Reply With Quote