-
5 Dec 2012 11:37 AM #1
Unanswered: external stores do not work in production build
Unanswered: external stores do not work in production build
Hi
I'm using a 'shared' folder (outside my project folder) with stores in it. However. when you do
$> sencha app build production
I get the following 404 in my browser:
As you can see the path is completely wrong. Furthermore, in the generated app.js the store is present!Code:MyProj/build/default/production/app/store/Test/store/MyStore.js?_dc=1354734754686 404 (Not Found)
This error can be reproduced to generate a default sencha app
Next, you need to add the shared folder to .sencha/app/app/sencha.cfgCode:$> sencha generate app --path path/to/MyProj
Create a store inside the shared folder and define it in app.js likeCode:app.name=defaultapp.framework=touch app.classpath=${app.dir}/app.js,${app.dir}/app,${app.dir}/../SHARED/src/
Thats it. I'm using 'Sencha Cmd v3.0.0.250' and the SDK is version 2.1.0Code://<debug> Ext.Loader.setPath({ 'Ext': 'touch/src', 'Test': '../SHARED/src', 'default': 'app' }); //</debug> Ext.application({ controllers: ["MyTest"], stores: ['Test.store.MyStore'], name: 'default', requires: [ 'Ext.MessageBox', 'Test.store.MyStore' ], .......
Cheers
-
7 Dec 2012 6:55 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
- Answers
- 3107
Getting that 404 means it was not picked up during the build. If you remove it from the stores array, does that help at all?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Dec 2012 10:26 AM #3
If I remove it from app.js and require it in the controller it works!! However you cannot do (in the controller):
it will return 'undefined'Code:var store = Ext.getStore('MyStore')
But if I do
I get the store.Code:var store = Ext.create('Test.store.MyStore');
So, it seems that requiring/defining a store in app.js doesn't work. A bug ?
I think this has worked in a previous version of the sencha touch tools!
Cheers


Reply With Quote