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