译自:http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.proxy.Proxy-cfg-reader
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.reader.Reader
The Ext.data.reader.Reader to use to decode the server's response or data read from client. This can either be a Reader instance, a config object or just a valid Reader type name (e.g. 'json', 'xml').
Available since: 4.0.4
Readers are used to interpret data to be loaded into a Model instance or a Store - often in response to an AJAX request. In general there is usually no need to create a Reader instance directly, since a Reader is almost always used together with a Proxy, and is configured using the Proxy's readerconfiguration property:
Ext.create('Ext.data.Store', {
model: 'User',
proxy: {
type: 'ajax',
url : 'users.json',
reader: {
type: 'json',
root: 'users'
}
},
});
The above reader is configured to consume a JSON string that looks something like this:
{
"success": true,
"users": [
{ "name": "User 1" },
{ "name": "User 2" }
]
}
Reader 用来解析被加载到Model实例或者Store中的数据 -通常用来相应一个 AJAX 请求。