Threaded View

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    vtu is on a distinguished road

      0  

    Default Answered: Dynamic Store using metadata Null model and fields

    Answered: Dynamic Store using metadata Null model and fields


    Hi I'm having an issue with my store using metadata. I get null values for model and fields when i do store.getFields() or store.getModel(). The store contains the relevant data in this case the users but the model and fields of the store is null. I would like to know what I'm missing in order to populate the fields and model. Thanks
    I'm using json similar to the following for testing.

    {"count":1,
    "ok":true,
    "msg":"Users found",
    "users":[{"userId":123,"name":"Ed Spencer","email":"ed@sencha.com"}],
    "metaData":{"idProperty":'userId',"rootProperty":"users","totalProperty":'count',"successProperty":'ok',"messageProperty":'msg', "fields":[ { "name": "userId", "type": "int" }, { "name": "name", "type": "string" }, { "name": "email", "type": "string" }
    ] }
    }


    My ModelExt.define('DST.model.DynamicModel', {
    extend: 'Ext.data.Model',
    config: {
    fields: []
    }
    });

    My Store
    Ext.define('DST.store.DynamicStore', {
    extend: 'Ext.data.Store',
    config:{
    model: 'DST.model.DynamicModel',
    proxy: {
    type: 'ajax',
    url: 'app/data/dynamictest.json',
    reader: {
    type: 'json',
    idProperty: 'id',
    rootProperty: 'root',
    totalProperty: 'total',
    successProperty: 'success',
    messageProperty: 'message'
    },
    timeout: 10000
    }
    }
    });



    Last edited by vtu; 6 Sep 2012 at 8:53 AM. Reason: make it more readable

  2. You would need to extend the reader and capture when it decodes the response so you can create your model.

Thread Participants: 1

Tags for this Thread

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