ExtJS: How do I get raw JSON data from Ext.data.Store?

c.sokun picture c.sokun · Feb 5, 2012 · Viewed 34.7k times · Source

From a typical store like this

Ext.define('User', {
    extend: 'Ext.data.Model',
    fields: [
        {name: 'firstName', type: 'string'},
        {name: 'lastName',  type: 'string'},
        {name: 'age',       type: 'int'},
        {name: 'eyeColor',  type: 'string'}
    ]
});

var myStore = Ext.create('Ext.data.Store', {
    model: 'User',
    proxy: {
        type: 'ajax',
        url : '/users.json',
        reader: {
            type: 'json',
            root: 'users'
        }
    },
    autoLoad: true
});

Is it possible to get raw Json from myStore?

Answer

Grant Zhu picture Grant Zhu · Feb 16, 2012

What about:

myStore.proxy.reader.rawData