Results 1 to 2 of 2

Thread: Loading store - behaving differently in "testing"

  1. #1
    Sencha Premium User alexander.urban's Avatar
    Join Date
    Nov 2013
    Posts
    324
    Answers
    9

    Default Loading store - behaving differently in "testing"

    Code:
    Ext.define('MyApp.view.AddressBook',
        extend:'Ext.dataview.List',
        config: {
        },
        constructor:function() {
            this.callParent(arguments);
            var dirstore = Ext.create("Ext.data.Store",{
                fields:['id','dbname','sname','dbtitle'],
                proxy: {
                    type: 'ajax',
                    headers: {'Content-Type': 'application/json'},
                    extraParams: {
                        q : 'directory'
                    },
                    url: ApiURI + 'AddressBook',
                    reader: {
                        type: 'json',
                        encode: false,
                        root: 'data'
                    }
                }
            });
            dirstore.on('load',function(store,recs) {
                console.log(recs);
            });
            dirstore.load();
    The call to AddressBook?_dc=1396619227000&q=directory&page=1&start=0&limit=25 returns

    Code:
    {"data":[{"id":"0","dbname":"Globale Standardadressliste","sname":"Globale Standardadressliste","dbtitle":"Globale Standardadressliste"}]}
    What would you expect to find in console, where I logged the records returned?

    This is what I got in the uncompiled version:

    Code:
    [Class]
    
    
    
    • 0: Class
      • _data: Object
        • dbname: "Globale Standardadressliste"
        • dbtitle: "Globale Standardadressliste"
        • id: "0"
        • sname: "Globale Standardadressliste"
        • __proto__: Object
      • data: Object
        • dbname: "Globale Standardadressliste"
        • dbtitle: "Globale Standardadressliste"
        • id: "0"
        • sname: "Globale Standardadressliste"
        • __proto__: Object
      • id: "ext-record-1002"
      • internalId: "0"
      • modified: Object
      • raw: Object
      • stores: Array[1]
      • __proto__: Object
    • length: 1
    • __proto__: Array[0]
    This is what I got in the "testing" version:

    Code:
    [Class]
    
    
    • 0: Class
      • _data: Object
        • dbname: undefined
        • dbtitle: undefined
        • id: "ext-record-1082"
        • sname: undefined
        • __proto__: Object
      • data: Object
        • dbname: undefined
        • dbtitle: undefined
        • id: "ext-record-1082"
        • sname: undefined
        • __proto__: Object
      • id: "ext-record-1082"
      • internalId: "ext-record-1082"
      • modified: Object
      • phantom: true
      • raw: Object
      • stores: Array[1]
      • __proto__: Object
    • length: 1
    • __proto__: Array[0]
    What did I do wrong?

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108
    Answers
    342

    Default

    Check the console for any warnings in development mode.
    Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services [email protected]

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

Posting Permissions

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