| Package: | Ext.grid |
| Defined In: | .js |
| Class: | |
| Extends: | Ext.data.DataReader |
注意:为了浏览器解析返回来的xml document对象,http response的content-type 头必须被设成text/xml
Example code:
var Employee = Ext.data.Record.create([
{name: 'name', mapping: 'name'}, // "mapping" property not needed if it's the same as "name"
{name: 'occupation'} // This field will use "occupation" as the mapping.
]);
var myReader = new Ext.data.XmlReader({
totalRecords: "results", // The element which contains the total dataset size (optional)
record: "row", // The repeated element which contains row information
id: "id" // The element within the row that provides an ID for the record (optional)
}, Employee);
This would consume an XML file like this:
<?xml?>
<dataset>
<results>2</results>
<row>
<id>1</id>
<name>Bill</name>
<occupation>Gardener</occupation>
</row>
<row>
<id>2</id>
<name>Ben</name>
<occupation>Horticulturalist</occupation>
</row>
</dataset>
@cfg {String} totalRecords DomQuery路径,据此可以找到数据集里的记录总行数.该属性仅当整个数据集里被一次性
拿出(而不是远程肥务器分页后的数据)时有用.
@cfg {String} record 包含记录信息的多个重复元素的DomQurey路径
@cfg {String} success 被forms使用的成功属性的DomQuery 路径
@cfg {String} id 关联记录元素到包含记录标识值元素的domQuery路径
| 属性 | 定义者 | |
|---|---|---|
|
this: XMLDocument
当有数据loads或reads后,原始的xml Document对于后...
当有数据loads或reads后,原始的xml Document对于后面的客户操作不可用!
|
XmlReader | |
|
meta: Mixed
This DataReader's configured metada...
This DataReader's configured metadata as passed to the constructor.
|
DataReader | |