4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-data-XmlStore'>/**
19 </span> * @author Ed Spencer
20 * @class Ext.data.XmlStore
21 * @extends Ext.data.Store
24 * <p>Small helper class to make creating {@link Ext.data.Store}s from XML data easier.
25 * A XmlStore will be automatically configured with a {@link Ext.data.reader.Xml}.</p>
26 * <p>A store configuration would be something like:<pre><code>
27 var store = new Ext.data.XmlStore({
31 url: 'sheldon.xml', // automatically configures a HttpProxy
33 record: 'Item', // records will have an "Item" tag
35 totalRecords: '@TotalResults'
37 // set up the fields mapping into the xml doc
38 // The first needs mapping, the others are very basic
39 {name: 'Author', mapping: 'ItemAttributes > Author'},
40 'Title', 'Manufacturer', 'ProductGroup'
43 * </code></pre></p>
44 * <p>This store is configured to consume a returned object of the form:<pre><code>
45 &#60?xml version="1.0" encoding="UTF-8"?>
46 &#60ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">
49 &#60IsValid>True&#60/IsValid>
50 &#60ItemSearchRequest>
51 &#60Author>Sidney Sheldon&#60/Author>
52 &#60SearchIndex>Books&#60/SearchIndex>
53 &#60/ItemSearchRequest>
55 &#60TotalResults>203&#60/TotalResults>
56 &#60TotalPages>21&#60/TotalPages>
58 &#60ASIN>0446355453&#60/ASIN>
59 &#60DetailPageURL>
60 http://www.amazon.com/
61 &#60/DetailPageURL>
62 &#60ItemAttributes>
63 &#60Author>Sidney Sheldon&#60/Author>
64 &#60Manufacturer>Warner Books&#60/Manufacturer>
65 &#60ProductGroup>Book&#60/ProductGroup>
66 &#60Title>Master of the Game&#60/Title>
67 &#60/ItemAttributes>
70 &#60/ItemSearchResponse>
71 * </code></pre>
72 * An object literal of this form could also be used as the {@link #data} config option.</p>
73 * <p><b>Note:</b> Although not listed here, this class accepts all of the configuration options of
74 * <b>{@link Ext.data.reader.Xml XmlReader}</b>.</p>
77 Ext.define('Ext.data.XmlStore', {
78 extend: 'Ext.data.Store',
79 alternateClassName: 'Ext.data.XmlStore',
82 <span id='Ext-data-XmlStore-cfg-reader'> /**
83 </span> * @cfg {Ext.data.DataReader} reader @hide
85 constructor: function(config){
86 config = config || {};
87 config = config || {};
97 this.callParent([config]);