PDA

View Full Version : Issue in using Memory proxy in a Model



hariharaprabhu
26 Sep 2011, 1:06 AM
Hi...

Please help me understand how to read data from json using memory proxy in a Model. I had tried but wasnt successful, the below is the code... kindly provide me ur suggestion

model:

Ext.regModel('ActionModel', {
fields: [
{ name: 'Key', type: 'string' },
{ name: 'Id', type: 'string' },
],
proxy: {
type: 'memory',
url: serviceUrl,
reader: {
type: 'json',
root: 'events'
}
}
});

Store:

this.store = new Ext.data.Store({
model: 'ActionModel',
data: this.data
});

JSON:

{
"success":true,
"status":"",
"error":"",
"events": [
{
"Key": 1234,
"Id": "89012",
}, {
"Key": 54321,
"Id": "89045"
}
]
}