PDA

View Full Version : JsonReader with multiple roots



suguna
23 Apr 2010, 6:16 AM
Hi,

I have a grid wherein I want to display some data and at the same I want to display some error messages to the user.How do I define JsonReader and Store in extjs if I want to use a json object as below? From the below example json data,

{
"resultData":[
{"entityId": "345","artist":"aaaaa","type":"Product","typeIdentifier":"DvdVideo"},
{"entityId": "968","artist":"bbbbb","type":"Product","typeIdentifier":"DvdAudio"}
],
"totalRows":2,
"errorData":[
{"entityId": "588", "message": "You cannot view this entity."},
{"entityId": "4567", "message": "You cannot view this entity."}
]
}

and how do I access data in "errorData" array in js file?


Thanks

sumit.madan
23 Apr 2010, 8:30 AM
Set a listener on store's exception event, this is also demonstrated in following ExtJS example:
http://www.extjs.com/deploy/dev/examples/writer/writer.html