1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Toronto
    Posts
    105
    Vote Rating
    2
    basememara is on a distinguished road

      0  

    Default Answered: How to create application functions for app-wide use?

    Answered: How to create application functions for app-wide use?


    I would like to create application wide functions so my controllers and views can use them. However, it is saying that my functions are undefined when I try to use them from other classes. This is what I am trying to do:

    Code:
    Ext.application({
        name: 'MyApp',
        someFunction: function(data) {
            alert(data.something);
        }
    });
    Then in my controller I try to do this: MyApp.someFunction(data), but it gives me this error:
    Uncaught TypeError: Cannot read property 'fn' of undefined

    What am I doing wrong?

  2. Instead of MyApp.SomeFunction() in controller use this.application.SomeFunction()

  3. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    49
    Vote Rating
    0
    Answers
    1
    Digital God is on a distinguished road

      0  

    Default


    Instead of MyApp.SomeFunction() in controller use this.application.SomeFunction()

Thread Participants: 1