1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    1
    Vote Rating
    0
    jnomula is on a distinguished road

      0  

    Default Sencha Cmd and Stores

    Sencha Cmd and Stores


    Hi,

    I am trying to do two things - .
    1. Use Sencha Cmd to generate stores
    2. Use Sencha Cmd to build the app

    Note: Currently using Sencha Cmd v3.0.0.250

    I am unable to generate a store using 'sencha cmd' as there is no option available to generate a store with 'sencha generate'.
    When I create a Store manually and do a 'sencha app build' , the build goes through fine, but when I try to load the script in a browser, I get errors. I tried to load the compressed version of the script after removing the stores, the script loads and executes just fine.

    Any thoughts?

    Thanks
    Last edited by jnomula; 24 Jan 2013 at 2:46 PM. Reason: indicate the current Sencha Cmd Version being used

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,034
    Vote Rating
    850
    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


    What errors are you getting in the app build?
    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
    Oct 2011
    Location
    Huntsville
    Posts
    231
    Vote Rating
    -6
    mark0978 is infamous around these parts mark0978 is infamous around these parts

      -4  

    Default


    Why is crap like this left on the forum? You never answered any of his questions (How do you add a store to an app with sencha command?) and it's just crap gunking up the search results.

  4. #4
    Sencha - Support Team keckeroo's Avatar
    Join Date
    Mar 2008
    Location
    Winnipeg, Canada
    Posts
    300
    Vote Rating
    9
    keckeroo will become famous soon enough

      2  

    Default


    I believe that an answer is trying to be found for the poster, but the difficult part is - without the error message that is being generated, it is nearly impossible to determine the problem.

    The ultimate goal is to find an solution to get the poster back up and running, regardless of what is or is not available in cmd. If a work around exists then that would be the logical avenue to pursue, short of responding with 'you have to wait for this to be implemented in cmd'.

    Ultimately - there would be no guarantee that if cmd generated a store for him, that something else was not causing the issue he is experiencing right now.

    So - for now - until more information is provided about the error being received, it's pretty much impossible to 'guess' at a solution that will work.

  5. #5
    Sencha User KJedi's Avatar
    Join Date
    Feb 2008
    Location
    Ukraine, Mykolayiv
    Posts
    145
    Vote Rating
    1
    KJedi is on a distinguished road

      0  

    Default


    I think that the problem is the way how he attaches store to the component. Try creating inline store in the component, something really simple like:
    Code:
    Ext.define('Myapp.myview', {
        extends: 'Ext.view.View',
        itemTpl: new Ext.XTemplate('<tpl for="."><strong>{name}</strong></tpl>'),
        itemSelector: 'div',
        store: new Ext.data.Store({
            fields:['name'],
            data:[
                {name:'John'},
                {name:'Jane'},
                {name:'Bob'},
            ]
        })
    })
    If it works, define the same store as standalone: move code to app/stores/MyStore.js, add it to app.js and reference in the test component by store id.

    If you get any problems, post the test code here, show errors you get and we'll do our best to help. Good luck!
    http://iqria.com/ http://frontendgeeks.com/
    JS ninjas. Delivering ExtJS apps since 2008.
    Providing development and consulting.

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,034
    Vote Rating
    850
    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

      1  

    Default


    Quote Originally Posted by KJedi View Post
    I think that the problem is the way how he attaches store to the component. Try creating inline store in the component, something really simple like:
    Code:
    Ext.define('Myapp.myview', {
        extends: 'Ext.view.View',
        itemTpl: new Ext.XTemplate('<tpl for="."><strong>{name}</strong></tpl>'),
        itemSelector: 'div',
        store: new Ext.data.Store({
            fields:['name'],
            data:[
                {name:'John'},
                {name:'Jane'},
                {name:'Bob'},
            ]
        })
    })
    If it works, define the same store as standalone: move code to app/stores/MyStore.js, add it to app.js and reference in the test component by store id.

    If you get any problems, post the test code here, show errors you get and we'll do our best to help. Good luck!
    This is a very bad way to assign a store for many reasons:

    1. If you aren't using ext-all.js (or -debug, -dev) then Ext.data.Store may not be loaded and will error out
    2. All instances of Myapp.myview will share the same store instance which is likely not what you want at all. Use a config object instead.
    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.