Roo.data.DataReader Roo.data.XmlReader
Package: | Roo.data |
Defined In: | Roo/data/XmlReader.js. |
Class: | XmlReader |
Extends: | Roo.data.DataReader |
Note that in order for the browser to parse a returned XML document, the Content-Type
header in the HTTP response must be set to "text/xml".
Example code:
var RecordDef = Roo.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 Roo.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)
}, RecordDef);
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>
Options | Defined By | |
---|---|---|
id : String
The DomQuery path relative from the record element to the element that contains
a record identifier value.
The DomQuery path relative from the record element to the element that contains
a record identifier value. |
Roo.data.XmlReader | |
record : String
The DomQuery path to the repeated element which contains record information.
The DomQuery path to the repeated element which contains record information.
|
Roo.data.XmlReader | |
success : String
The DomQuery path to the success attribute used by forms.
The DomQuery path to the success attribute used by forms.
|
Roo.data.XmlReader | |
totalRecords : String
The DomQuery path from which to retrieve the total number of records
in the dataset.
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. |
Roo.data.XmlReader |
Method | Defined By | |
---|---|---|
new Roo.data.XmlReader
(Object meta, Mixed recordType)
Create a new Roo.data.XmlReader
Create a new Roo.data.XmlReader
|
||
newRow
(Object data)
:
Roo.data.Record
Create an empty record
Create an empty record
|
Roo.data.DataReader | |
This method is only used by a DataProxy which has retrieved data from a remote server.
This method is only used by a DataProxy which has retrieved data from a remote server.
|
Roo.data.XmlReader | |
Roo.data.XmlReader |