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-ArrayStore-method-constructor'><span id='Ext-data-ArrayStore'>/**
19 </span></span> * @author Ed Spencer
20 * @class Ext.data.ArrayStore
21 * @extends Ext.data.Store
24 * <p>Small helper class to make creating {@link Ext.data.Store}s from Array data easier.
25 * An ArrayStore will be automatically configured with a {@link Ext.data.reader.Array}.</p>
27 * <p>A store configuration would be something like:</p>
28 <pre><code>
29 var store = new Ext.data.ArrayStore({
37 {name: 'price', type: 'float'},
38 {name: 'change', type: 'float'},
39 {name: 'pctChange', type: 'float'},
40 {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
43 </code></pre>
44 * <p>This store is configured to consume a returned object of the form:
45 <pre><code>
47 ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
48 ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
49 ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
50 ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
51 ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
53 </code></pre>
55 * <p>An object literal of this form could also be used as the {@link #data} config option.</p>
57 * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of
58 * <b>{@link Ext.data.reader.Array ArrayReader}</b>.</p>
61 * @param {Object} config
64 Ext.define('Ext.data.ArrayStore', {
65 extend: 'Ext.data.Store',
67 uses: ['Ext.data.reader.Array'],
69 <span id='Ext-data-ArrayStore-cfg-reader'> /**
70 </span> * @cfg {Ext.data.DataReader} reader @hide
72 constructor: function(config) {
73 config = config || {};
82 this.callParent([config]);
85 loadData: function(data, append) {
86 if (this.expandData === true) {
91 for (; i < ln; i++) {
92 r[r.length] = [data[i]];
98 this.callParent([data, append]);
102 Ext.data.SimpleStore = Ext.data.ArrayStore;
103 // Ext.reg('simplestore', Ext.data.SimpleStore);