Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / source / ArrayReader.html
diff --git a/docs/source/ArrayReader.html b/docs/source/ArrayReader.html
deleted file mode 100644 (file)
index 0504167..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<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>
-</head>
-<body  onload="prettyPrint();">
-    <pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.3.1
- * Copyright(c) 2006-2010 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-<div id="cls-Ext.data.ArrayReader"></div>/**
- * @class Ext.data.ArrayReader
- * @extends Ext.data.JsonReader
- * <p>Data reader class to create an Array of {@link Ext.data.Record} objects from an Array.
- * Each element of that Array represents a row of data fields. The
- * fields are pulled into a Record object using as a subscript, the <code>mapping</code> property
- * of the field definition if it exists, or the field's ordinal position in the definition.</p>
- * <p>Example code:</p>
- * <pre><code>
-var Employee = Ext.data.Record.create([
-    {name: 'name', mapping: 1},         // "mapping" only needed if an "id" field is present which
-    {name: 'occupation', mapping: 2}    // precludes using the ordinal position as the index.
-]);
-var myReader = new Ext.data.ArrayReader({
-    {@link #idIndex}: 0
-}, Employee);
-</code></pre>
- * <p>This would consume an Array like this:</p>
- * <pre><code>
-[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
- * </code></pre>
- * @constructor
- * Create a new ArrayReader
- * @param {Object} meta Metadata configuration options.
- * @param {Array/Object} recordType
- * <p>Either an Array of {@link Ext.data.Field Field} definition objects (which
- * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record}
- * constructor created from {@link Ext.data.Record#create}.</p>
- */
-Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, {
-    <div id="cfg-Ext.data.ArrayReader-successProperty"></div>/**
-     * @cfg {String} successProperty
-     * @hide
-     */
-    <div id="cfg-Ext.data.ArrayReader-id"></div>/**
-     * @cfg {Number} id (optional) The subscript within row Array that provides an ID for the Record.
-     * Deprecated. Use {@link #idIndex} instead.
-     */
-    <div id="cfg-Ext.data.ArrayReader-idIndex"></div>/**
-     * @cfg {Number} idIndex (optional) The subscript within row Array that provides an ID for the Record.
-     */
-    <div id="method-Ext.data.ArrayReader-readRecords"></div>/**
-     * Create a data block containing Ext.data.Records from an Array.
-     * @param {Object} o An Array of row objects which represents the dataset.
-     * @return {Object} data A data block which is used by an Ext.data.Store object as
-     * a cache of Ext.data.Records.
-     */
-    readRecords : function(o){
-        this.arrayData = o;
-        var s = this.meta,
-            sid = s ? Ext.num(s.idIndex, s.id) : null,
-            recordType = this.recordType,
-            fields = recordType.prototype.fields,
-            records = [],
-            success = true,
-            v;
-
-        var root = this.getRoot(o);
-
-        for(var i = 0, len = root.length; i < len; i++) {
-            var n = root[i],
-                values = {},
-                id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null);
-            for(var j = 0, jlen = fields.length; j < jlen; j++) {
-                var f = fields.items[j],
-                    k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j;
-                v = n[k] !== undefined ? n[k] : f.defaultValue;
-                v = f.convert(v, n);
-                values[f.name] = v;
-            }
-            var record = new recordType(values, id);
-            record.json = n;
-            records[records.length] = record;
-        }
-
-        var totalRecords = records.length;
-
-        if(s.totalProperty) {
-            v = parseInt(this.getTotal(o), 10);
-            if(!isNaN(v)) {
-                totalRecords = v;
-            }
-        }
-        if(s.successProperty){
-            v = this.getSuccess(o);
-            if(v === false || v === 'false'){
-                success = false;
-            }
-        }
-
-        return {
-            success : success,
-            records : records,
-            totalRecords : totalRecords
-        };
-    }
-});</pre>    
-</body>
-</html>
\ No newline at end of file