3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
8 * @class Ext.data.XmlStore
\r
9 * @extends Ext.data.Store
\r
10 * <p>Small helper class to make creating {@link Ext.data.Store}s from XML data easier.
\r
11 * A XmlStore will be automatically configured with a {@link Ext.data.XmlReader}.</p>
\r
12 * <p>A store configuration would be something like:<pre><code>
\r
13 var store = new Ext.data.XmlStore({
\r
17 url: 'sheldon.xml', // automatically configures a HttpProxy
\r
19 record: 'Item', // records will have an "Item" tag
\r
21 totalRecords: '@TotalResults'
\r
23 // set up the fields mapping into the xml doc
\r
24 // The first needs mapping, the others are very basic
\r
25 {name: 'Author', mapping: 'ItemAttributes > Author'},
\r
26 'Title', 'Manufacturer', 'ProductGroup'
\r
30 * <p>This store is configured to consume a returned object of the form:<pre><code>
\r
31 <?xml version="1.0" encoding="UTF-8"?>
\r
32 <ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">
\r
35 <IsValid>True</IsValid>
\r
36 <ItemSearchRequest>
\r
37 <Author>Sidney Sheldon</Author>
\r
38 <SearchIndex>Books</SearchIndex>
\r
39 </ItemSearchRequest>
\r
41 <TotalResults>203</TotalResults>
\r
42 <TotalPages>21</TotalPages>
\r
44 <ASIN>0446355453</ASIN>
\r
46 http://www.amazon.com/
\r
49 <Author>Sidney Sheldon</Author>
\r
50 <Manufacturer>Warner Books</Manufacturer>
\r
51 <ProductGroup>Book</ProductGroup>
\r
52 <Title>Master of the Game</Title>
\r
53 </ItemAttributes>
\r
56 </ItemSearchResponse>
\r
58 * An object literal of this form could also be used as the {@link #data} config option.</p>
\r
59 * <p><b>Note:</b> Although not listed here, this class accepts all of the configuration options of
\r
60 * <b>{@link Ext.data.XmlReader XmlReader}</b>.</p>
\r
62 * @param {Object} config
\r
65 Ext.data.XmlStore = Ext.extend(Ext.data.Store, {
\r
67 * @cfg {Ext.data.DataReader} reader @hide
\r
69 constructor: function(config){
\r
70 Ext.data.XmlStore.superclass.constructor.call(this, Ext.apply(config, {
\r
71 reader: new Ext.data.XmlReader(config)
\r
75 Ext.reg('xmlstore', Ext.data.XmlStore);