4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/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:** This class accepts all of the configuration options of {@link Ext.data.reader.Array ArrayReader}.
55 Ext.define('Ext.data.ArrayStore', {
56 extend: 'Ext.data.Store',
58 uses: ['Ext.data.reader.Array'],
60 constructor: function(config) {
61 config = config || {};
70 this.callParent([config]);
73 loadData: function(data, append) {
74 if (this.expandData === true) {
79 for (; i < ln; i++) {
80 r[r.length] = [data[i]];
86 this.callParent([data, append]);
90 Ext.data.SimpleStore = Ext.data.ArrayStore;
91 // Ext.reg('simplestore', Ext.data.SimpleStore);