1. #1
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Vote Rating
    48
    Malte123 is infamous around these parts Malte123 is infamous around these parts

      1  

    Default Cmd generated Base App - Ext.application() cause error on "config.name"

    Cmd generated Base App - Ext.application() cause error on "config.name"


    Ext version tested:
    • Ext 4.2.1
    Browser versions tested against:
    • Safari 4
    Description:
    • Using Ext.application() causes in
      TypeError: 'undefined' is not an object (evaluating 'config.name')
    Steps to reproduce the problem:
    • Generate an App with Sencha CMD
    • Execute Ext.application(); within a Class-Constructor
    • Instantiate and take a look on Console
    The result that was expected:
    • Get Application Name to go forward with Ext.application().getController('controllername') for example
    The result that occurs instead:
    • TypeError: 'undefined' is not an object (evaluating 'config.name')

  2. #2
    Sencha Premium Member Fredric Berling's Avatar
    Join Date
    Sep 2007
    Location
    Sweden
    Posts
    188
    Vote Rating
    15
    Fredric Berling has a spectacular aura about Fredric Berling has a spectacular aura about

      2  

    Default


    Not sure if you are supposed to use it that way.

    To access a controller from a controller you would simply use this.getController('ControllerName')

    To get a controller instance from the window scope you can do: MyApp.app.getController('ControllerName').
    To get your application instance from the controller scope you can do: MyApp.app.getApplication()
    To get your application instance from the window scope you can do: MyApp.app

    "MyApp" would be the top namespace/application name in your app.

    The Ext.application() function is only used in app.js in the application folder.

  3. #3
    Sencha User
    Join Date
    Dec 2013
    Posts
    84
    Vote Rating
    48
    Malte123 is infamous around these parts Malte123 is infamous around these parts

      0  

    Default


    first: thanks for thinking about !

    The Ext.application() function is only used in app.js in the application folder.
    I am developing an UX and I am needed to get access to Application-Events independent from what the Programmer wants to do with my Fassade-Class. So it should be really easy to use.
    like this.
    PHP Code:
    var service Ext.widget('AliasNameOfClass',{
    param1'value'
    }).on('readyLoadingAndDecryptingTimeIntenciveRemoteData',function(){
     
    console.log(service);
    }) 
    I cannot find where I have read about to use Ext.application() to go forward with getController() instead of the known Name of Application like "MyApp".

    I have seen the Problem maybe causes of the Structuring of Code Sencha CMD builds.
    I have not checked whether I can get what I want when I use a self made initial Codestructur.
    (Because it should be unimportant)

    So the Question is:

    How can I get Application-Name out of UX ?

Thread Participants: 1

Tags for this Thread