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

      0  

    Default Complex JSON populating store

    Complex JSON populating store


    I'm having an issue trying to populate a JsonStore in extjs. I'm trying to use the mapping property for the fields, but I'm obviously missing something for the JSON that is being returned from the server. I would like to grab the fields columnA, columnB and columnC to populate a grid.

    Here is the JSON
    Code:
    {"invUploadTemplates":[{"templateName":"Hedge Fund Onshore","documentType":{"code":"10","description":"Announcement"},"templateDocDescriptions":[{"columnA":"Only 1 description","columnB":"N","columnC":"Y"}],"templateComments":[{"columnA":"N074796","columnB":"04/05/2012 17:26:31","columnC":"Test Comment"}],"docID":"383720332049434D35204C53444244313020494E5655504C544D504C35392032362041313030313030314131324430354237323633314A30363738303138204131324430354237323633314A3036373830312031342031313233","docRetrieveURL":"http://xxx/secure/blah/blah?id=383720332049434D35204C53444244313020494E5655504C544D504C35392032362041313030313030314131324430354237323633314A30363738303138204131324430354237323633314A3036373830312031342031313233|CM|INVUPLTMPL|Template Document|USA|DEV4|Y"},{"templateName":"Hedge Fund Onshore","documentType":{"code":"11","description":"Closing Documents"},"templateDocDescriptions":[{"columnA":"desc 2","columnB":"N","columnC":"N"},{"columnA":"desc 1","columnB":"N","columnC":"Y"}],"templateComments":[],"docID":"383720332049434D35204C53444244313020494E5655504C544D504C3539203236204131303031303031413132443035423732373132423932333231313820413132443035423732373132423932333231312031342031313233","docRetrieveURL":"http://xxx/secure/blah/blah?id=383720332049434D35204C53444244313020494E5655504C544D504C3539203236204131303031303031413132443035423732373132423932333231313820413132443035423732373132423932333231312031342031313233|CM|INVUPLTMPL|Template Document|USA|DEV4|Y"},{"templateName":"Hedge Fund Onshore","documentType":{"code":"09","description":"Letter"},"templateDocDescriptions":[{"columnA":"Doc Desc 1","columnB":"Y","columnC":"N"},{"columnA":"Doc Desc 2","columnB":"N","columnC":"Y"}],"templateComments":[],"docID":"383720332049434D35204C53444244313020494E5655504C544D504C3539203236204131303031303031413132443039423332363038443539373339313820413132443039423332363038443539373339312031342031313233","docRetrieveURL":"http://xxx/secure/blah/blah?id=383720332049434D35204C53444244313020494E5655504C544D504C3539203236204131303031303031413132443039423332363038443539373339313820413132443039423332363038443539373339312031342031313233|CM|INVUPLTMPL|Template Document|USA|DEV4|Y"}],"responseCode":"200","responseMessage":"OK","success":true}
    And here is what I have been trying in the store.
    Code:
    var documentDescriptionEditStore = new Ext.data.JsonStore({
        idProperty: 'docDescEdit',
        autoDestroy: true,
        url: 'http://localhost:9080/secure/CitadelService/rest/citadeldatasvcs/getSelectedInvUploadTemplates',
        root: 'invUploadTemplates',
        sortInfo: {
            field: 'docDescEdit',
            direction: 'ASC'
        },
        fields: [{name: 'docDescEdit', mapping: 'templateDocDescriptions.columnA'}, {name: 'requiredEdit', mapping: 'templateDocDescriptions.columnB'}, {name: 'genericEdit', mapping: 'templateDocDescriptions.columnC'}]
    });
    
    TIA

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    88
    Vote Rating
    1
    Ash2009 is on a distinguished road

      0  

    Default


    try this..
    change the root : 'invUploadTemplates.templateDocDescriptions' and use direct mapping like
    [{name:'docDescEdit' , mapping:'columnA},{},{}]

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