Hybrid View

    Success! Looks like we've fixed this one. According to our records the fix was applied for a bug in our system in a recent build.
  1. #1
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default [4.1.1] Controller's modules load problem

    [4.1.1] Controller's modules load problem


    If in a controller I set the model and store configs then I get a file load error with a strange path: app/controller/Main.js/model/file.js .

    Then I took a look in controllers method "onClassExtended" and seems that this line is the reason of load fail:
    Code:
    namespace = Ext.Loader.getPrefix(className) || match[1]; // = "AppNamespace.controller.Main" || "AppNamespace";
    
    If "namespace" var would have the second value "AppNamespace" then load will be ok
    Last edited by vadimv; 1 Oct 2012 at 3:27 AM. Reason: sentence correction

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,999
    Vote Rating
    649
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Not really sure what the bug is here, can you elaborate a bit?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    there sth wrong here ?, is there sth else to do after app generation with Sencha Cmd 181 on MacOSX 10.6.8 (besides enabling Loader) so that not to receive that loading error. To reproduce it is very simple, just generate the app and then generate a model and then try to build that app.

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Posts
    75
    Vote Rating
    4
    devnullable is on a distinguished road

      0  

    Default


    Vadimv, did you find any solution?

    I encountered the same problem. I am not 100% sure but this may have to do something where you put your models and views declarations. If you define them inside Ext.application everything seems to work ok but if you define them in the controller then it fails like you said.

    For example you have controller Car, and model Car. If you define models: ['Car'] inside controller Car then Loader tries to load /app/controller/Car.js/model/Car.js which naturally fails. But if you define models: ['Car'] inside Ext.application then it should work.

    Where we should define models and views? I would like to declare them in corresponding controller, not in Ext.application.

  5. #5
    Sencha User
    Join Date
    Oct 2010
    Posts
    75
    Vote Rating
    4
    devnullable is on a distinguished road

      0  

    Default


    If I want to define store in corresponding controller I have to use fully qualified name

    Code:
    requires: ['MyCarApp.stores.Car'],
    stores: ['MyCarApp.stores.Car']
    which of course generates getter method named getMyCarAppStoresCarStore which is not so cool

    I am using 4.1.1a and Sencha Cmd v3.0.0.190

  6. #6
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    devnullable@, yes I know about all these things, my temporary solution is to take the namespace from the match[1]. I remember that in previous versions I have hadn't such issues, was just specifying app's path in Loader and everything worked, but with the new Sencha Cmd sth is working differently, which I don't know what yet.

  7. #7
    Sencha User
    Join Date
    Oct 2010
    Posts
    75
    Vote Rating
    4
    devnullable is on a distinguished road

      0  

    Default


    getPrefix function has following code:
    Code:
    if (paths.hasOwnProperty(className)) 
       return className;
    }
    bootstrap.js indeed has a entry for AppName.controller.Main and therefore hole class name is returned. If I comment out the controller entry in bootstrap.js the if statement returns false and the rest of the getPrefix function works as expected and returns only the AppName.

    I don't know what is the purpose of the shown code and why it returns fully qualified path?