initial import
[roojs1] / Roo / data / SimpleStore.js
1 /*
2  * Based on:
3  * Ext JS Library 1.1.1
4  * Copyright(c) 2006-2007, Ext JS, LLC.
5  *
6  * Originally Released Under LGPL - original licence link has changed is not relivant.
7  *
8  * Fork - LGPL
9  * <script type="text/javascript">
10  */
11
12 /**
13  * @class Roo.data.SimpleStore
14  * @extends Roo.data.Store
15  * Small helper class to make creating Stores from Array data easier.
16  * @cfg {Number} id The array index of the record id. Leave blank to auto generate ids.
17  * @cfg {Array} fields An array of field definition objects, or field name strings.
18  * @cfg {Array} data The multi-dimensional array of data
19  * @constructor
20  * @param {Object} config
21  */
22 Roo.data.SimpleStore = function(config){
23     Roo.data.SimpleStore.superclass.constructor.call(this, {
24         isLocal : true,
25         reader: new Roo.data.ArrayReader({
26                 id: config.id
27             },
28             Roo.data.Record.create(config.fields)
29         ),
30         proxy : new Roo.data.MemoryProxy(config.data)
31     });
32     this.load();
33 };
34 Roo.extend(Roo.data.SimpleStore, Roo.data.Store);