Results 1 to 8 of 8

Thread: Need to update documentation for Ext.data.Store

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default Need to update documentation for Ext.data.Store

    Hi Sencha Touch team,

    While upgrading my application from ST2PR3 to ST2RC, I got problem with the store:

    [WARN][Ext.data.Store#setModel] Unless you define your model through metadata, a store needs to have a model defined on either itself or on its proxy

    My code (conform to the Ext.data.Store documentation):
    Code:
    Ext.define('MyApp.store.Calls', {
        extend: 'Ext.data.Store',
        model: 'MyApp.model.Call',
        sorters: [
        {
            property: 'date',
            direction: 'ASC'
        }
        ]
    });
    The fix:
    Code:
    Ext.define('ATT.lib.dialer.store.Calls', {
        extend: 'Ext.data.Store',
        config: {
            model: 'ATT.lib.dialer.model.Call',
            sorters: [
            {
                property: 'date',
                direction: 'ASC'
            }
            ]
        }
    });
    Can you update the documentation of Ext.data.Store to show the mandatory use of config.

    Thanks for your awesome work on this release!

    Simon

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Sure. Please note that the config object should be used for all configs and all classes now when you use Ext.define.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Actually I don't see anywhere where Ext.define is used to create a store. Where in the documentation would the change be needed?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    On my application, I use Ext.define to define my store. It is not in the documentation.
    I got an error because the config:{} was missing.

    I don't see the config: {} in the documentation for Ext.data.Store. That is why I suggest you to add it in the documentation.

    Thanks again.

  5. #5
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Well, it should be known that anytime you use Ext.define you should put configs into the config object, this is standard across ST2.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  6. #6
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
      0  

    Default

    In the Ext.data.Store example documentation, it does use a config in it's Ext.define statement.

    http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Store

    Code:
    // Set up a model to use in our Store
    Ext.define('User', {
        extend: 'Ext.data.Model',
        config: {
            fields: [
                {name: 'firstName', type: 'string'},
                {name: 'lastName',  type: 'string'},
                {name: 'age',       type: 'int'},
                {name: 'eyeColor',  type: 'string'}
            ]
        }
    });
    Is this the documentation you used?

    Sencha Inc

    Jamie Avins

    @jamieavins

  7. #7
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    Quote Originally Posted by Jamie Avins View Post
    In the Ext.data.Store example documentation, it does use a config in it's Ext.define statement.

    http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Store

    Code:
    // Set up a model to use in our Store
    Ext.define('User', {
        extend: 'Ext.data.Model',
        config: {
            fields: [
                {name: 'firstName', type: 'string'},
                {name: 'lastName',  type: 'string'},
                {name: 'age',       type: 'int'},
                {name: 'eyeColor',  type: 'string'}
            ]
        }
    });
    Is this the documentation you used?
    Think he misunderstood that Ext.data.Store there wasn't an example with Ext.define using the config object. That example was for Ext.data.Model but all Ext.define calls should use config object for config items.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  8. #8
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    131
    Vote Rating
    -2
      0  

    Default

    Hi,

    Does it also true for 'proxy' ?

    NB : why goes this way at Sencha Team ??!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •