3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
18 * Small helper class to make creating {@link Ext.data.Store}s from Array data easier. An ArrayStore will be
19 * automatically configured with a {@link Ext.data.reader.Array}.
21 * A store configuration would be something like:
23 * var store = Ext.create('Ext.data.ArrayStore', {
31 * {name: 'price', type: 'float'},
32 * {name: 'change', type: 'float'},
33 * {name: 'pctChange', type: 'float'},
34 * {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
38 * This store is configured to consume a returned object of the form:
41 * ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
42 * ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
43 * ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
44 * ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
45 * ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
48 * An object literal of this form could also be used as the {@link #data} config option.
50 * **Note:** This class accepts all of the configuration options of {@link Ext.data.reader.Array ArrayReader}.
52 Ext.define('Ext.data.ArrayStore', {
53 extend: 'Ext.data.Store',
55 uses: ['Ext.data.reader.Array'],
57 constructor: function(config) {
58 config = config || {};
67 this.callParent([config]);
70 loadData: function(data, append) {
71 if (this.expandData === true) {
77 r[r.length] = [data[i]];
83 this.callParent([data, append]);
87 Ext.data.SimpleStore = Ext.data.ArrayStore;
88 // Ext.reg('simplestore', Ext.data.SimpleStore);