Last change
on this file since 619 was
619,
checked in by ramonb, 15 years ago
|
lib/:
- added new AJAX dependancies: ExtJS, pChart, Lightbox2
|
File size:
1.3 KB
|
Line | |
---|
1 | /* |
---|
2 | * Ext JS Library 2.2.1 |
---|
3 | * Copyright(c) 2006-2009, Ext JS, LLC. |
---|
4 | * licensing@extjs.com |
---|
5 | * |
---|
6 | * http://extjs.com/license |
---|
7 | */ |
---|
8 | |
---|
9 | /** |
---|
10 | * @class Ext.data.SimpleStore |
---|
11 | * @extends Ext.data.Store |
---|
12 | * Small helper class to make creating Stores from Array data easier. |
---|
13 | * @cfg {Number} id The array index of the record id. Leave blank to auto generate ids. |
---|
14 | * @cfg {Array} fields An array of field definition objects, or field name string as specified to {@link Ext.data.Record#create} |
---|
15 | * @cfg {Array} data The multi-dimensional array of data. |
---|
16 | * @constructor |
---|
17 | * @param {Object} config |
---|
18 | */ |
---|
19 | Ext.data.SimpleStore = function(config){ |
---|
20 | Ext.data.SimpleStore.superclass.constructor.call(this, Ext.apply(config, { |
---|
21 | reader: new Ext.data.ArrayReader({ |
---|
22 | id: config.id |
---|
23 | }, |
---|
24 | Ext.data.Record.create(config.fields) |
---|
25 | ) |
---|
26 | })); |
---|
27 | }; |
---|
28 | Ext.extend(Ext.data.SimpleStore, Ext.data.Store, { |
---|
29 | loadData : function(data, append){ |
---|
30 | if(this.expandData === true){ |
---|
31 | var r = []; |
---|
32 | for(var i = 0, len = data.length; i < len; i++){ |
---|
33 | r[r.length] = [data[i]]; |
---|
34 | } |
---|
35 | data = r; |
---|
36 | } |
---|
37 | Ext.data.SimpleStore.superclass.loadData.call(this, data, append); |
---|
38 | } |
---|
39 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.