PDA

View Full Version : Finding app folder outside of current path



FPXdeveloper_4
30 Nov 2011, 2:33 PM
Because I'm operating on a strange server setup (which wont be changed) my app folder is located outside of the webpage's current path. Say the webpage is located at:
www.myhost.com/abc/index.html (http://www.myhost.com/abc/index.html)
Then my application file would be at
www.myhost.com/xui/app.js (http://www.myhost.com/xui/app.js)

To handle this, my application has the following code


Ext.Loader.setConfig({
enabled:true,
paths: {
'Ext.ux': '../xui/ux',
'app': '../xui/app'
}
});


Which works until I run it through the builder, upon which I get the following error:

Failed to load resource: the server responded with a status of 404 (Not Found) http://www.myhost.com/abc/app/model/SectionModel.js
Somehow my ../xui got lost so it is still looking for my code inside of abc which doesn't have it.

It seems as if the problem is that the loader code above is in the application, which is the last thing to be included in app-all.js. If I hand-edit app-all.js to relocate the loader code to the top, then everything works. I don't think I should have to hand-edit this file though.

mitchellsimoens
1 Dec 2011, 9:09 AM
Did you set the appFolder in the Ext.application?

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.app.Application-cfg-appFolder

What happens is Ext.app.Application adds the path into the Loader depending on the name and the appFolder properties which will overwrite any paths you set in the Loader.setConfig

FPXdeveloper_4
1 Dec 2011, 9:11 AM
Cool thanks.