3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.2
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
15 <div id="cls-Ext.data.XmlStore"></div>/**
16 * @class Ext.data.XmlStore
17 * @extends Ext.data.Store
18 * <p>Small helper class to make creating {@link Ext.data.Store}s from XML data easier.
19 * A XmlStore will be automatically configured with a {@link Ext.data.XmlReader}.</p>
20 * <p>A store configuration would be something like:<pre><code>
21 var store = new Ext.data.XmlStore({
25 url: 'sheldon.xml', // automatically configures a HttpProxy
27 record: 'Item', // records will have an "Item" tag
29 totalRecords: '@TotalResults'
31 // set up the fields mapping into the xml doc
32 // The first needs mapping, the others are very basic
33 {name: 'Author', mapping: 'ItemAttributes > Author'},
34 'Title', 'Manufacturer', 'ProductGroup'
38 * <p>This store is configured to consume a returned object of the form:<pre><code>
39 <?xml version="1.0" encoding="UTF-8"?>
40 <ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">
43 <IsValid>True</IsValid>
44 <ItemSearchRequest>
45 <Author>Sidney Sheldon</Author>
46 <SearchIndex>Books</SearchIndex>
47 </ItemSearchRequest>
49 <TotalResults>203</TotalResults>
50 <TotalPages>21</TotalPages>
52 <ASIN>0446355453</ASIN>
54 http://www.amazon.com/
57 <Author>Sidney Sheldon</Author>
58 <Manufacturer>Warner Books</Manufacturer>
59 <ProductGroup>Book</ProductGroup>
60 <Title>Master of the Game</Title>
64 </ItemSearchResponse>
66 * An object literal of this form could also be used as the {@link #data} config option.</p>
67 * <p><b>Note:</b> Although not listed here, this class accepts all of the configuration options of
68 * <b>{@link Ext.data.XmlReader XmlReader}</b>.</p>
70 * @param {Object} config
73 Ext.data.XmlStore = Ext.extend(Ext.data.Store, {
74 <div id="cfg-Ext.data.XmlStore-reader"></div>/**
75 * @cfg {Ext.data.DataReader} reader @hide
77 constructor: function(config){
78 Ext.data.XmlStore.superclass.constructor.call(this, Ext.apply(config, {
79 reader: new Ext.data.XmlReader(config)
83 Ext.reg('xmlstore', Ext.data.XmlStore);</pre>