1. #1
    Ext JS Premium Member
    Join Date
    Apr 2008
    Location
    San Francisco, CA
    Posts
    10
    Vote Rating
    0
    stormin_walker is on a distinguished road

      0  

    Default this.$namespace not handling deep namespaces in Ext.app.Application

    this.$namespace not handling deep namespaces in Ext.app.Application


    I have an application with the name set as "Yada.yada" i.e.,:

    Code:
    new Ext.app.Application({
          name: "YADA.yada"
    });
    however in the code use in getView, getModel and getStore the this.$namespace property returns "YADA" meaning that it won't create views etc.

    Code:
    Ext.app.Controller.getFullName(name, 'store', this.$namespace);
    It might be the funky way I'm trying to use Ext.app.Application - however it always used to work (and was working in the earlier 4.2 beta). Seems all the changes to the MVC system have broken my use case. I have a workaround (overriding Ext.app.Application and forcing this.$namespace to be correct).
    CTO @ Xero - Beautiful Accounting Software (http://xero.com/)

  2. #2
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    226
    Vote Rating
    43
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    Hi Craig,

    Hmm, that one's interesting. You see, $namespace property holds Controller (and Application, too) namespace that should have been resolved at class creation time. If it gets incorrect value, it means namespace resolution is broken somehow. I'm not sure exactly what sort of funky you're doing, and I can't reproduce this in my setup. Can you show me more code please?

    Regards,
    Alex.

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2008
    Location
    San Francisco, CA
    Posts
    10
    Vote Rating
    0
    stormin_walker is on a distinguished road

      0  

    Default


    Did you try anything other than Controllers? For controllers it works out of the box. For views it doesn't. Case in point - trying to create the Viewport (YADA.yada.view.Viewport) - it would try to create YADA.view.Viewport - it would drop off every other part of the namespace. Seems to be something weird going on in the onClassExtended process.
    CTO @ Xero - Beautiful Accounting Software (http://xero.com/)

  4. #4
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    226
    Vote Rating
    43
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      0  

    Default


    I used the simplest form:

    Code:
    Ext.application({
        name: 'YADA.yada',
        appFolder: 'yada',
    
        controllers: ['Foo'],
    
        autoCreateViewport: true
    });
    Besides YADA.yada.controller.Foo, there are two view classes: YADA.yada.view.Viewport and YADA.yada.view.Bar that gets displayed in the viewport. All class names get resolved correctly, that's why I'm asking you to give me some more clue.

    Regards,
    Alex.

Thread Participants: 1