Class Ext.data.XmlReader
Package: | Ext.data |
Class: | XmlReader |
Extends: | Ext.data.DataReader |
Defined In: | XmlReader.js |
Data reader class to create an Array of
Ext.data.Record objects from an XML document
based on mappings in a provided Ext.data.Record constructor.
The code below lists all configuration options.
var myReader = new Ext.data.XmlReader({
record: "row", // The repeated element which contains record information
totalRecords: "results", // The element which contains the number of returned records (可选)
id: "id" // The element within the record that provides an ID for the record (可选)
}, myRecordDefinition);
This would consume an XML file like this:
<?xml?>
<dataset>
<results>2</results>
<row>
<id>1</id>
<name>Bill</name>
</row>
<row>
<id>2</id>
<name>Ben</name>
</row>
</dataset>
属性
-
方法
-
事件
-
设置选项
公共属性
|
xmlData : XMLDocument |
XmlReader |
After any data loads/reads, the raw XML Document is available for further custom processing. |
公共方法
|
XmlReader(Object meta , Mixed recordType ) |
XmlReader |
Create a new XmlReader |
|
read(Object response ) : Object |
XmlReader |
This method is only used by a DataProxy which has retrieved data from a remote server. |
|
readRecords(Object doc ) : Object |
XmlReader |
Create a data block containing Ext.data.Records from an XML document. |
公共事件
此类没有公共事件。
设置选项
|
id : String |
XmlReader |
The DomQuery path relative from the record element to the element that contains a record identifier value. |
|
record : String |
XmlReader |
The DomQuery path to the repeated element which contains record information. |
|
success : String |
XmlReader |
The DomQuery path to the success attribute used by forms. |
|
totalRecords : String |
XmlReader |
The DomQuery path from which to retrieve the total number of records in the dataset. This is only needed if the whole... |
属性详情
xmlData
public XMLDocument xmlData
After any data loads/reads, the raw XML Document is available for further custom processing.
This property is defined by XmlReader.
构造函数
XmlReader
public function XmlReader(Object meta
, Mixed recordType
)
方法详情
read
public function read(Object response
)
This method is only used by a DataProxy which has retrieved data from a remote server.
This method is defined by XmlReader.
readRecords
public function readRecords(Object doc
)
Create a data block containing Ext.data.Records from an XML document.
参数:
doc
: ObjectA parsed XML document.
返回:
This method is defined by XmlReader.
设置详情
id
id : String
The DomQuery path relative from the record element to the element that contains a record identifier value.
This config option is defined by XmlReader.
record
record : String
The DomQuery path to the repeated element which contains record information.
This config option is defined by XmlReader.
success
success : String
The DomQuery path to the success attribute used by forms.
This config option is defined by XmlReader.
totalRecords
totalRecords : String
The DomQuery path from which to retrieve the total number of records in the dataset. This is only needed if the whole dataset is not passed in one go, but is being paged from the remote server.
This config option is defined by XmlReader.