/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ Ext.data.JsonP.Ext_data_XmlReader({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.data.DataReader","uses":[],"html":"

Hierarchy

Ext.data.DataReader
Ext.data.XmlReader

Files

Data reader class to create an Array of Ext.data.Record objects from an XML document\nbased on mappings in a provided Ext.data.Record constructor.

\n\n\n

Note: that in order for the browser to parse a returned XML document, the Content-Type\nheader in the HTTP response must be set to \"text/xml\" or \"application/xml\".

\n\n\n

Example code:

\n\n\n
var Employee = Ext.data.Record.create([\n   {name: 'name', mapping: 'name'},     // \"mapping\" property not needed if it is the same as \"name\"\n   {name: 'occupation'}                 // This field will use \"occupation\" as the mapping.\n]);\nvar myReader = new Ext.data.XmlReader({\n   totalProperty: \"results\", // The element which contains the total dataset size (optional)\n   record: \"row\",           // The repeated element which contains row information\n   idProperty: \"id\"         // The element within the row that provides an ID for the record (optional)\n   messageProperty: \"msg\"   // The element within the response that provides a user-feedback message (optional)\n}, Employee);\n
\n\n\n

\nThis would consume an XML file like this:\n

<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<dataset>\n <results>2</results>\n <row>\n   <id>1</id>\n   <name>Bill</name>\n   <occupation>Gardener</occupation>\n </row>\n <row>\n   <id>2</id>\n   <name>Ben</name>\n   <occupation>Horticulturalist</occupation>\n </row>\n</dataset>\n
\n\n

Defined By

Config options

Either an Array of Field definition objects (which\nwill be passed to Ext.data.Record.create, or a Record\nconstructor ...

Either an Array of Field definition objects (which\nwill be passed to Ext.data.Record.create, or a Record\nconstructor created from Ext.data.Record.create.

\n\n
Ext.data.XmlReader
view source
idPath : String

The DomQuery path relative from the record element to the element that contains\na record identifier value.

\n

The DomQuery path relative from the record element to the element that contains\na record identifier value.

\n

[undefined] Optional name of a property within a server-response that represents a user-feedback message.

\n

[undefined] Optional name of a property within a server-response that represents a user-feedback message.

\n
Ext.data.XmlReader
view source
record : String

The DomQuery path to the repeated element which contains record information.

\n

The DomQuery path to the repeated element which contains record information.

\n

The DomQuery path to the success attribute used by forms.

\n

The DomQuery path to the success attribute used by forms.

\n
Ext.data.XmlReader
view source
: String
The DomQuery path from which to retrieve the total number of records\nin the dataset. ...

The DomQuery path from which to retrieve the total number of records\nin the dataset. This is only needed if the whole dataset is not passed in one go, but is being\npaged from the remote server.

\n
Defined By

Properties

This DataReader's configured metadata as passed to the constructor.

\n

This DataReader's configured metadata as passed to the constructor.

\n
Ext.data.XmlReader
view source
xmlData : XMLDocument

After any data loads/reads, the raw XML Document is available for further custom processing.

\n

After any data loads/reads, the raw XML Document is available for further custom processing.

\n
Defined By

Methods

Ext.data.XmlReader
view source
new( meta, recordType ) : Ext.data.XmlReader
Create a new XmlReader. ...

Create a new XmlReader.

\n

Parameters

Returns

Overrides: Ext.data.DataReader.constructor

Abstract method, overridden in DataReader extensions such as Ext.data.JsonReader and Ext.data.XmlReader ...

Abstract method, overridden in DataReader extensions such as Ext.data.JsonReader and Ext.data.XmlReader

\n
( data-root, returnRecords )private
returns extracted, type-cast rows of data. ...

returns extracted, type-cast rows of data. Iterates to call extractValues for each row

\n

Parameters

  • data-root : Object[]/Object

    from server response

    \n
  • returnRecords : Boolean

    [false] Set true to return instances of Ext.data.Record

    \n
Abstract method overridden in DataReader extensions such as Ext.data.JsonReader and Ext.data.XmlReader ...

Abstract method overridden in DataReader extensions such as Ext.data.JsonReader and Ext.data.XmlReader

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Abstract method created in extension's buildExtractors impl. ...

Abstract method created in extension's buildExtractors impl.

\n
Returns true if the supplied data-hash looks and quacks like data. ...

Returns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key\ncorresponding to idProperty defined in your DataReader config containing non-empty pk.

\n

Parameters

  • data : Object
    \n

Returns

  • Boolean
    \n
Ext.data.XmlReader
view source
( response ) : Object
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.

\n

Parameters

  • response : Object

    The XHR object which contains the parsed XML document. The response is expected\nto contain a property called responseXML which refers to an XML document object.

    \n

Returns

  • Object

    records A data block which is used by an Ext.data.Store as\na cache of Ext.data.Records.

    \n
Ext.data.XmlReader
view source
( doc ) : Object
Create a data block containing Ext.data.Records from an XML document. ...

Create a data block containing Ext.data.Records from an XML document.

\n

Parameters

  • doc : Object

    A parsed XML document.

    \n

Returns

  • Object

    records A data block which is used by an Ext.data.Store as\na cache of Ext.data.Records.

    \n
Ext.data.XmlReader
view source
( action, response ) : Ext.data.Response
Decode an XML response from server. ...

Decode an XML response from server.

\n

Parameters

Returns

Used for un-phantoming a record after a successful database insert. ...

Used for un-phantoming a record after a successful database insert. Sets the records pk along with new data from server.\nYou must return at least the database pk using the idProperty defined in your DataReader configuration. The incoming\ndata from server will be merged with the data in the local record.\nIn addition, you must return record-data from the server in the same order received.\nWill perform a commit as well, un-marking dirty-fields. Store's \"update\" event will be suppressed.

\n

Parameters

  • record : Record/Record[]

    The phantom record to be realized.

    \n
  • data : Object/Object[]

    The new record data to apply. Must include the primary-key from database defined in idProperty field.

    \n
Used for updating a non-phantom or \"real\" record's data with fresh data from server after remote-save. ...

Used for updating a non-phantom or \"real\" record's data with fresh data from server after remote-save.\nIf returning data from multiple-records after a batch-update, you must return record-data from the server in\nthe same order received. Will perform a commit as well, un-marking dirty-fields. Store's \"update\" event will be\nsuppressed as the record receives fresh new data-hash

\n

Parameters

  • rs : Record/Record[]
    \n
  • data : Object/Object[]
    \n
","superclasses":["Ext.data.DataReader"],"meta":{},"requires":[],"html_meta":{},"statics":{"property":[],"cfg":[],"css_var":[],"method":[],"event":[],"css_mixin":[]},"files":[{"href":"XmlReader.html#Ext-data-XmlReader","filename":"XmlReader.js"}],"linenr":1,"members":{"property":[{"tagname":"property","owner":"Ext.data.DataReader","meta":{},"name":"meta","id":"property-meta"},{"tagname":"property","owner":"Ext.data.XmlReader","meta":{},"name":"xmlData","id":"property-xmlData"}],"cfg":[{"tagname":"cfg","owner":"Ext.data.DataReader","meta":{},"name":"fields","id":"cfg-fields"},{"tagname":"cfg","owner":"Ext.data.XmlReader","meta":{},"name":"idPath","id":"cfg-idPath"},{"tagname":"cfg","owner":"Ext.data.DataReader","meta":{},"name":"messageProperty","id":"cfg-messageProperty"},{"tagname":"cfg","owner":"Ext.data.XmlReader","meta":{},"name":"record","id":"cfg-record"},{"tagname":"cfg","owner":"Ext.data.XmlReader","meta":{},"name":"successProperty","id":"cfg-successProperty"},{"tagname":"cfg","owner":"Ext.data.XmlReader","meta":{},"name":"totalProperty","id":"cfg-totalProperty"}],"css_var":[],"method":[{"tagname":"method","owner":"Ext.data.XmlReader","meta":{},"name":"constructor","id":"method-constructor"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"buildExtractors","id":"method-buildExtractors"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{"private":true},"name":"extractData","id":"method-extractData"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"extractValues","id":"method-extractValues"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getId","id":"method-getId"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getMessage","id":"method-getMessage"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getRoot","id":"method-getRoot"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getSuccess","id":"method-getSuccess"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"getTotal","id":"method-getTotal"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"isData","id":"method-isData"},{"tagname":"method","owner":"Ext.data.XmlReader","meta":{},"name":"read","id":"method-read"},{"tagname":"method","owner":"Ext.data.XmlReader","meta":{},"name":"readRecords","id":"method-readRecords"},{"tagname":"method","owner":"Ext.data.XmlReader","meta":{},"name":"readResponse","id":"method-readResponse"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"realize","id":"method-realize"},{"tagname":"method","owner":"Ext.data.DataReader","meta":{},"name":"update","id":"method-update"}],"event":[],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.data.XmlReader","singleton":false,"override":null,"inheritdoc":null,"id":"class-Ext.data.XmlReader","mixins":[],"mixedInto":[]});