tvheadend/vendor/ext-3.4.1/docs/source/ArrayStore.html
Adam Sutton bafcfff42d webui: restructure webui/extjs source files
I want to keep the 3rd-party packages away from the main source
where possible.
2013-06-03 17:11:01 +01:00

83 lines
3.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='Ext-data-ArrayStore-method-constructor'><span id='Ext-data-ArrayStore'>/**
</span></span> * @class Ext.data.ArrayStore
* @extends Ext.data.Store
* &lt;p&gt;Formerly known as &quot;SimpleStore&quot;.&lt;/p&gt;
* &lt;p&gt;Small helper class to make creating {@link Ext.data.Store}s from Array data easier.
* An ArrayStore will be automatically configured with a {@link Ext.data.ArrayReader}.&lt;/p&gt;
* &lt;p&gt;A store configuration would be something like:&lt;pre&gt;&lt;code&gt;
var store = new Ext.data.ArrayStore({
// store configs
autoDestroy: true,
storeId: 'myStore',
// reader configs
idIndex: 0,
fields: [
'company',
{name: 'price', type: 'float'},
{name: 'change', type: 'float'},
{name: 'pctChange', type: 'float'},
{name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
]
});
* &lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
* &lt;p&gt;This store is configured to consume a returned object of the form:&lt;pre&gt;&lt;code&gt;
var myData = [
['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
];
* &lt;/code&gt;&lt;/pre&gt;
* An object literal of this form could also be used as the {@link #data} config option.&lt;/p&gt;
* &lt;p&gt;&lt;b&gt;*Note:&lt;/b&gt; Although not listed here, this class accepts all of the configuration options of
* &lt;b&gt;{@link Ext.data.ArrayReader ArrayReader}&lt;/b&gt;.&lt;/p&gt;
* @constructor
* @param {Object} config
* @xtype arraystore
*/
Ext.data.ArrayStore = Ext.extend(Ext.data.Store, {
<span id='Ext-data-ArrayStore-cfg-reader'> /**
</span> * @cfg {Ext.data.DataReader} reader @hide
*/
constructor: function(config){
Ext.data.ArrayStore.superclass.constructor.call(this, Ext.apply(config, {
reader: new Ext.data.ArrayReader(config)
}));
},
<span id='Ext-data-ArrayStore-method-loadData'> loadData : function(data, append){
</span> if(this.expandData === true){
var r = [];
for(var i = 0, len = data.length; i &lt; len; i++){
r[r.length] = [data[i]];
}
data = r;
}
Ext.data.ArrayStore.superclass.loadData.call(this, data, append);
}
});
Ext.reg('arraystore', Ext.data.ArrayStore);
// backwards compat
Ext.data.SimpleStore = Ext.data.ArrayStore;
Ext.reg('simplestore', Ext.data.SimpleStore);</pre>
</body>
</html>