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'>/**
19 </span> * @author Ed Spencer
21 * Small helper class to make creating {@link Ext.data.Store}s from Array data easier. An ArrayStore will be
22 * automatically configured with a {@link Ext.data.reader.Array}.
24 * A store configuration would be something like:
26 * var store = Ext.create('Ext.data.ArrayStore', {
34 * {name: 'price', type: 'float'},
35 * {name: 'change', type: 'float'},
36 * {name: 'pctChange', type: 'float'},
37 * {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
41 * This store is configured to consume a returned object of the form:
44 * ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
45 * ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
46 * ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
47 * ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
48 * ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
51 * An object literal of this form could also be used as the {@link #data} config option.
53 * **Note:** Although not listed here, this class accepts all of the configuration options of
54 * **{@link Ext.data.reader.Array ArrayReader}**.
56 Ext.define('Ext.data.ArrayStore', {
57 extend: 'Ext.data.Store',
59 uses: ['Ext.data.reader.Array'],
61 constructor: function(config) {
62 config = config || {};
71 this.callParent([config]);
74 loadData: function(data, append) {
75 if (this.expandData === true) {
80 for (; i < ln; i++) {
81 r[r.length] = [data[i]];
87 this.callParent([data, append]);
91 Ext.data.SimpleStore = Ext.data.ArrayStore;
92 // Ext.reg('simplestore', Ext.data.SimpleStore);