1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    22
    Vote Rating
    0
    sophicworks is on a distinguished road

      0  

    Default Unanswered: Failed to load resources when using Ext.Loader.setPath

    Unanswered: Failed to load resources when using Ext.Loader.setPath


    Hi, I'am new to extjs and I a have an application with a namespace of APP
    and try to do load another application path name FW

    Code:
    Ext.Loader.setPath('FW', '/assets/sophic/home/app');
    
    Ext.application({
        name: 'APP',
        appFolder: '/assets/apollo/home/app',
        
        reuires: [
                  'FW.common.controller.Main',
                  'FW.controller.Main',
                  'APP.view.Viewport'
                  ],
        
        autoCreateViewport: true,
        
        controllers: [
                       'FW.common.controller.Main',
                       'FW.controller.Main',
                       'APP.controller.Main',
                      ]
    });
    Code:
    Ext.define('APP.controller.Main', {
        extend: 'Ext.app.Controller',
        
        stores: [
                   'FW.store.Users',
                   'FW.store.Dictionary'
                ],
         ....
    });


    the problem is if I remove the Users store file (APP/home/app/store/Users.js)
    it give me this error
    Failed to load resource: the server responded with a status of 404 (Not Found)

    even if I did not use APP/home/app/store/Users.js

    Users grid list(FW.view.user.List)
    Code:
    Ext.Loader.setConfig({enabled: true});
    
    
    Ext.define('FW.view.user.List' ,{
        extend: 'FW.common.view.SophicGridList',
        id: 'userGridPanel',
        alias : 'widget.userlist',
        moduleName: 'user',
        
        store: 'FW.store.Users',
        
        initComponent: function() {
    
    
            this.columns = [
            { text: 'ID', flex: 1,   dataIndex: 'id', hidden: true},
            { text: 'User Name', flex: 1.2, dataIndex: 'user_name'},
            { text: 'Email', flex: .5, dataIndex: 'email' },
            { text: 'Roles', flex: .5, dataIndex: 'user_role', hidden: true }
            ];
            
            this.dockedItems.push({
              
                xtype: 'pagingtoolbar',
                id: 'user_pagingtoolbar',
                store: 'FW.store.Users',
                dock: 'bottom',
            });
         }
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So in the controller you are requiring the FW.store.Users store which should try to load at the http://somedomain/assets/sophic/home/app/store/Users.js but the path that is actually trying to load is different?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    22
    Vote Rating
    0
    sophicworks is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    So in the controller you are requiring the FW.store.Users store which should try to load at the http://somedomain/assets/sophic/home/app/store/Users.js but the path that is actually trying to load is different?
    thanks for the reply and sorry for my late response wasn't able to check my account for a while.

    my problem is somehow like that. it loads the APP.store.Users.js even if I didn't use it in my application,
    is there a way to find out what file in my application is calling the APP.store.Users.js after throwing the error? I tried to debug it with developer tool in chrome but I just can't figure out how.