Results 1 to 2 of 2

Thread: Does a Ext.data.reader.Json use an idProperty? If not, bug in docs

    Success! Looks like we've fixed this one. According to our records the fix was applied for a bug in our system in a recent build.
  1. #1
    Sencha Premium User
    Join Date
    Aug 2009
    Location
    Amsterdam, NY
    Posts
    41

    Default Does a Ext.data.reader.Json use an idProperty? If not, bug in docs

    If you check out the JsonStore docs: http://docs.sencha.com/ext/5.0.0/api...data.JsonStore
    There is this example below which suggests a json reader can use an 'idProperty' config option. I know Model's use that, but I can't find anything about a reader using it. Does anything other than a Model use the idProperty?

    Also I noticed the 'root' config option for the reader is used but the docs for the reader say to use 'rootProperty', which I assume is the recommended config property to use?

    Code:
    var store = new Ext.data.JsonStore({
        // store configs
        storeId: 'myStore',
    
    
        proxy: {
            type: 'ajax',
            url: 'get-images.php',
            reader: {
                type: 'json',
                root: 'images',
                idProperty: 'name'       <--------- 
            }
        },
    
    
        //alternatively, a Ext.data.Model name can be given (see Ext.data.Store for an example)
        fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
    });
    Thanks!

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    Correct, there's no idProperty for the reader, it's a doc bug.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Posting Permissions

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