1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    134
    Vote Rating
    3
    jeanluca is on a distinguished road

      0  

    Default 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!

    This error can be reproduced to generate a default sencha app

    Code:
    $> sencha generate app --path path/to/MyProj
    Next, you need to add the shared folder to .sencha/app/app/sencha.cfg
    Code:
    app.name=defaultapp.framework=touch
    app.classpath=${app.dir}/app.js,${app.dir}/app,${app.dir}/../SHARED/src/
    Create a store inside the shared folder and define it in app.js like

    Code:
    //<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'
        ],
        .......
    Thats it. I'm using 'Sencha Cmd v3.0.0.250' and the SDK is version 2.1.0

    Cheers

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,674
    Vote Rating
    435
    Answers
    3110
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Jun 2010
    Posts
    134
    Vote Rating
    3
    jeanluca is on a distinguished road

      0  

    Default


    If I remove it from app.js and require it in the controller it works!! However you cannot do (in the controller):

    Code:
    var store = Ext.getStore('MyStore')
    it will return 'undefined'
    But if I do

    Code:
    var store = Ext.create('Test.store.MyStore');
    I get the store.
    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