Fix #6201 - Category select
[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 {Object} an existing reader (eg. copied from another store)
19  * @cfg {Array} data The multi-dimensional array of data
20  * @constructor
21  * @param {Object} config
22  */
23 Roo.data.SimpleStore = function(config)
24 {
25     Roo.data.SimpleStore.superclass.constructor.call(this, {
26         isLocal : true,
27         reader: typeof(config.reader) != 'undefined' ? config.reader : new Roo.data.ArrayReader({
28                 id: config.id
29             },
30             Roo.data.Record.create(config.fields)
31         ),
32         proxy : new Roo.data.MemoryProxy(config.data)
33     });
34     this.load();
35 };
36 Roo.extend(Roo.data.SimpleStore, Roo.data.Store);