Results 1 to 7 of 7

Thread: UX Development: Add Controller causes in typeError

  1. #1
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Answers
    6

    Default Answered: UX Development: Add Controller causes in typeError

    I am developing an UX - and to manage Timing by Events, I need them on Application-Level.

    To do this I need to get an Controller on Application-Level, the UX will be implemented by the Main-App. This could be done by
    PHP Code:

    Ext
    .app.Controller.getController('testController'); 
    Related to this:
    http://docs-origin.sencha.com/extjs/...-getController

    I should get an new Instance of Ext.app.Controller

    But it ends into an error:
    TypeError: 'undefined' is not a function (evaluating 'Ext.app.Controller.getController('testController')')
    My main JS called app.js:
    PHP Code:
    Ext.Loader.setPath('Ext.ux''ext/src/ux');
    Ext.application({
        
    controllers: ["Main"],

        
    views: ["Main"],


        
    name'UXdevFramework',

        
    autoCreateViewporttrue
    }); 
    I hoped so much people today - now I need Ideas myself :-)

    PHP Code:
    // do you know: I tryed to make all Last Posted Users "Malte123" ... but I got a "Moderator has to review your Post" ...  ... I want to do this and send a Screenshot LOL 

  2. Based on evants Help - this could be marked as solved:

    Solution is:

    PHP Code:

    Ext
    .app.Application.instance.getController('controllerName'); 

  3. #2
    Sencha User
    Join Date
    Jan 2013
    Location
    Germany, Freiburg i. Br.
    Posts
    38
    Answers
    5

    Default

    http://docs-origin.sencha.com/extjs/...-getController

    is written what undefined meens

    Note that this method dependson Application instance and will return undefined when Application is notaccessible.

  4. #3
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Answers
    6

    Default

    is written what undefined means
    Yes - but what is the reason the Application isn't accessible ?

  5. #4
    Sencha User
    Join Date
    Jan 2013
    Location
    Germany, Freiburg i. Br.
    Posts
    38
    Answers
    5

    Default

    Hope you get help because you helped a lot of people yesterday ... - I have no Idea - sorry

    I vote you up (knowing you love it )

  6. #5
    Sencha Premium Member
    Join Date
    Oct 2013
    Location
    Slovakia
    Posts
    80
    Answers
    2

    Default

    Try this:

    Code:
    App.getApplication().getController('Security')
    where 'App' is the application namespace and 'Security' is name of controller class (do not use controller id, there is a bug, you have to access controller by its class name)

  7. #6
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Answers
    6

    Default

    Try this:

    Code:

    App.getApplication().getController('Security')
    where 'App' is the application namespace and 'Security' is name of controller class (do not use controller id, there is a bug, you have to access controller by its class name)
    I need a solution I can access out of UX.

    So if I need to find a way to get Applications name :-)

    Ext.application.name

    or

    Ext.application.getName()

    doesn't work :-(

  8. #7
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Answers
    6

    Default

    Based on evants Help - this could be marked as solved:

    Solution is:

    PHP Code:

    Ext
    .app.Application.instance.getController('controllerName'); 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •