Threaded View

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    34
    Vote Rating
    2
    Answers
    3
    deliriousrhino is on a distinguished road

      0  

    Default 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?




  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

Thread Participants: 1

Tags for this Thread