1. #1
    Sencha User
    Join Date
    Sep 2009
    Posts
    53
    Vote Rating
    0
    vmadman is on a distinguished road

      0  

    Default Code for Stores

    Code for Stores


    Can the code generator create the code for the stores I create?

    Currently it seems to just reference them by name, like:

    store: 'MyStore'

    But does not, in any way, define MyStore in the outputted class/json code.

    Will this be added? And, will the custom components api (coming soon I assume) also support custom stores?

    Thanks,
    Luke

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,306
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Luke -

    Take a look at the store files which are generated.
    Code:
    /*
     * File: CompanyStore.js
     * Date: Wed Mar 31 2010 08:22:10 GMT-0700 (PDT)
     * 
     * This file was generated by Ext Designer version 1.0.0.
     * http://www.extjs.com/products/designer/
     *
     * This file will be generated the first time you export.
     *
     * You should implement event handling and custom methods in this
     * class. 
     */
    
    CompanyStore = Ext.extend(Ext.data.ArrayStore, {
        constructor: function() {
            CompanyStore.superclass.constructor.call(this, {
                storeId: 'CompanyStore',
                fields : [
                {
                    xtype: 'datafield',
                    name: 'company',
                    type: 'auto'
                },
                {
                    xtype: 'datafield',
                    name: 'price',
                    type: 'float'
                },
                {
                    xtype: 'datafield',
                    name: 'change',
                    type: 'float'
                },
                {
                    xtype: 'datafield',
                    name: 'pctChange',
                    type: 'float'
                },
                {
                    xtype: 'datafield',
                    name: 'lastChange',
                    type: 'date',
                    dateFormat: 'n/j h:ia'
                }
            ]
            });
        }
    });
    new CompanyStore();
    These files are generated once you can remove them to re-create them if you need any changes made to them.

    And, will the custom components api (coming soon I assume) also support custom stores?
    Yes.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Sep 2009
    Posts
    53
    Vote Rating
    0
    vmadman is on a distinguished road

      0  

    Default


    Shouldn't they be recreated during each export, regardless of whether or not the file already exists?

    I have not managed to get a project to export yet (the button is greyed out). What conditions is it waiting for before allowing me to export?

    Thanks,
    Luke

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,306
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by vmadman View Post
    Shouldn't they be recreated during each export, regardless of whether or not the file already exists?
    Yes, I believe we are going to change this behavior.

    Quote Originally Posted by vmadman View Post
    I have not managed to get a project to export yet (the button is greyed out). What conditions is it waiting for before allowing me to export?
    You need to have a project to export the project. Save the project and the export button will be enabled. By default, generated code will saved in the same directory as where the .xds file resides. You can change this by going to Edit -> Preferences and providing a relative directory to where the .xds file is.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1