1. #1
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    23
    Vote Rating
    1
    Beth_B is on a distinguished road

      0  

    Default JSON Help

    JSON Help


    I am trying to pull json data. The store is created; the data is pulled; however, the data is not in the store. The proxy returns {"Bars":[{"Name":"Sunday","Data":10},{"Name":"Monday","Data":20},{"Name":"Tuesday","Data":30},{"Name":"Wednesday","Data":40},{"Name":"Thursday","Data":50}]}. I have the following js:

    Ext.define('ModelX', {
    extend:
    'Ext.data.Model',
    fields: [
    { name:
    'Name', mapping: 'Name', type: 'string' },
    { name:
    'Data', mapping: 'Data', type: 'int' }
    ]
    });


    var myStore = Ext.create('Ext.data.Store', {
    model: 'ModelX',
    proxy: {
    type: 'ajax',
    url: 'Home/TestData',
    reader: {
    type: 'json',
    root: 'Bars'
    }
    },
    listeners: {
     
    exception: { fn: function (el, response, operation, eOpts) {
    var error = operation.getError();
    console.log("ERROR: " + error);
    }
    }//end exception
    },
    autoLoad: true
    });

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Vote Rating
    321
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    How are you ascertaining that there's no data in the store? Like this perhaps?

    Code:
    listeners: {
        load: function(store) {
            console.log(store.getCount());
        }
    }

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    23
    Vote Rating
    1
    Beth_B is on a distinguished road

      0  

    Default Thanks for help

    Thanks for help


    Thank you! Apparently I was checking the data store values before they were populated. I thought I had a blocking action but it looks like I did not.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi