PDA

View Full Version : Failed to load resources when using Ext.Loader.setPath



sophicworks
18 Oct 2012, 11:51 PM
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


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',
]
});



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)

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',
});
}
});

mitchellsimoens
23 Oct 2012, 6:32 AM
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?

sophicworks
30 Oct 2012, 7:05 PM
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.