Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / source / widgets / DataView.js
diff --git a/source/widgets/DataView.js b/source/widgets/DataView.js
deleted file mode 100644 (file)
index 5c44cbc..0000000
+++ /dev/null
@@ -1,724 +0,0 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.DataView\r
- * @extends Ext.BoxComponent\r
- * A mechanism for displaying data using custom layout templates and formatting. DataView uses an {@link Ext.XTemplate}\r
- * as its internal templating mechanism, and is bound to an {@link Ext.data.Store}\r
- * so that as the data in the store changes the view is automatically updated to reflect the changes.  The view also\r
- * provides built-in behavior for many common events that can occur for its contained items including click, doubleclick,\r
- * mouseover, mouseout, etc. as well as a built-in selection model. <b>In order to use these features, an {@link #itemSelector}\r
- * config must be provided for the DataView to determine what nodes it will be working with.</b>\r
- *\r
- * <p>The example below binds a DataView to a {@link Ext.data.Store} and renders it into an {@link Ext.Panel}.</p>\r
- * <pre><code>\r
-var store = new Ext.data.JsonStore({\r
-    url: 'get-images.php',\r
-    root: 'images',\r
-    fields: [\r
-        'name', 'url',\r
-        {name:'size', type: 'float'},\r
-        {name:'lastmod', type:'date', dateFormat:'timestamp'}\r
-    ]\r
-});\r
-store.load();\r
-\r
-var tpl = new Ext.XTemplate(\r
-    '&lt;tpl for="."&gt;',\r
-        '&lt;div class="thumb-wrap" id="{name}"&gt;',\r
-        '&lt;div class="thumb"&gt;&lt;img src="{url}" title="{name}"&gt;&lt;/div&gt;',\r
-        '&lt;span class="x-editable"&gt;{shortName}&lt;/span&gt;&lt;/div&gt;',\r
-    '&lt;/tpl&gt;',\r
-    '&lt;div class="x-clear"&gt;&lt;/div&gt;'\r
-);\r
-\r
-var panel = new Ext.Panel({\r
-    id:'images-view',\r
-    frame:true,\r
-    width:535,\r
-    autoHeight:true,\r
-    collapsible:true,\r
-    layout:'fit',\r
-    title:'Simple DataView',\r
-\r
-    items: new Ext.DataView({\r
-        store: store,\r
-        tpl: tpl,\r
-        autoHeight:true,\r
-        multiSelect: true,\r
-        overClass:'x-view-over',\r
-        itemSelector:'div.thumb-wrap',\r
-        emptyText: 'No images to display'\r
-    })\r
-});\r
-panel.render(document.body);\r
-</code></pre>\r
- * @constructor\r
- * Create a new DataView\r
- * @param {Object} config The config object\r
- */\r
-Ext.DataView = Ext.extend(Ext.BoxComponent, {\r
-    /**\r
-     * @cfg {String/Array} tpl\r
-     * The HTML fragment or an array of fragments that will make up the template used by this DataView.  This should\r
-     * be specified in the same format expected by the constructor of {@link Ext.XTemplate}.\r
-     */\r
-    /**\r
-     * @cfg {Ext.data.Store} store\r
-     * The {@link Ext.data.Store} to bind this DataView to.\r
-     */\r
-    /**\r
-     * @cfg {String} itemSelector\r
-     * <b>This is a required setting</b>. A simple CSS selector (e.g. div.some-class or span:first-child) that will be \r
-     * used to determine what nodes this DataView will be working with.\r
-     */\r
-    /**\r
-     * @cfg {Boolean} multiSelect\r
-     * True to allow selection of more than one item at a time, false to allow selection of only a single item\r
-     * at a time or no selection at all, depending on the value of {@link #singleSelect} (defaults to false).\r
-     */\r
-    /**\r
-     * @cfg {Boolean} singleSelect\r
-     * True to allow selection of exactly one item at a time, false to allow no selection at all (defaults to false).\r
-     * Note that if {@link #multiSelect} = true, this value will be ignored.\r
-     */\r
-    /**\r
-     * @cfg {Boolean} simpleSelect\r
-     * True to enable multiselection by clicking on multiple items without requiring the user to hold Shift or Ctrl,\r
-     * false to force the user to hold Ctrl or Shift to select more than on item (defaults to false).\r
-     */\r
-    /**\r
-     * @cfg {String} overClass\r
-     * A CSS class to apply to each item in the view on mouseover (defaults to undefined).\r
-     */\r
-    /**\r
-     * @cfg {String} loadingText\r
-     * A string to display during data load operations (defaults to undefined).  If specified, this text will be\r
-     * displayed in a loading div and the view's contents will be cleared while loading, otherwise the view's\r
-     * contents will continue to display normally until the new data is loaded and the contents are replaced.\r
-     */\r
-    /**\r
-     * @cfg {String} selectedClass\r
-     * A CSS class to apply to each selected item in the view (defaults to 'x-view-selected').\r
-     */\r
-    selectedClass : "x-view-selected",\r
-    /**\r
-     * @cfg {String} emptyText\r
-     * The text to display in the view when there is no data to display (defaults to '').\r
-     */\r
-    emptyText : "",\r
-\r
-    /**\r
-     * @cfg {Boolean} deferEmptyText True to defer emptyText being applied until the store's first load\r
-     */\r
-    deferEmptyText: true,\r
-    /**\r
-     * @cfg {Boolean} trackOver True to enable mouseenter and mouseleave events\r
-     */\r
-    trackOver: false,\r
-\r
-    //private\r
-    last: false,\r
-\r
-\r
-    // private\r
-    initComponent : function(){\r
-        Ext.DataView.superclass.initComponent.call(this);\r
-        if(typeof this.tpl == "string"){\r
-            this.tpl = new Ext.XTemplate(this.tpl);\r
-        }\r
-\r
-        this.addEvents(\r
-            /**\r
-             * @event beforeclick\r
-             * Fires before a click is processed. Returns false to cancel the default action.\r
-             * @param {Ext.DataView} this\r
-             * @param {Number} index The index of the target node\r
-             * @param {HTMLElement} node The target node\r
-             * @param {Ext.EventObject} e The raw event object\r
-             */\r
-            "beforeclick",\r
-            /**\r
-             * @event click\r
-             * Fires when a template node is clicked.\r
-             * @param {Ext.DataView} this\r
-             * @param {Number} index The index of the target node\r
-             * @param {HTMLElement} node The target node\r
-             * @param {Ext.EventObject} e The raw event object\r
-             */\r
-            "click",\r
-            /**\r
-             * @event mouseenter\r
-             * Fires when the mouse enters a template node. trackOver:true or an overCls must be set to enable this event.\r
-             * @param {Ext.DataView} this\r
-             * @param {Number} index The index of the target node\r
-             * @param {HTMLElement} node The target node\r
-             * @param {Ext.EventObject} e The raw event object\r
-             */\r
-            "mouseenter",\r
-            /**\r
-             * @event mouseleave\r
-             * Fires when the mouse leaves a template node. trackOver:true or an overCls must be set to enable this event.\r
-             * @param {Ext.DataView} this\r
-             * @param {Number} index The index of the target node\r
-             * @param {HTMLElement} node The target node\r
-             * @param {Ext.EventObject} e The raw event object\r
-             */\r
-            "mouseleave",\r
-            /**\r
-             * @event containerclick\r
-             * Fires when a click occurs and it is not on a template node.\r
-             * @param {Ext.DataView} this\r
-             * @param {Ext.EventObject} e The raw event object\r
-             */\r
-            "containerclick",\r
-            /**\r
-             * @event dblclick\r
-             * Fires when a template node is double clicked.\r
-             * @param {Ext.DataView} this\r
-             * @param {Number} index The index of the target node\r
-             * @param {HTMLElement} node The target node\r
-             * @param {Ext.EventObject} e The raw event object\r
-             */\r
-            "dblclick",\r
-            /**\r
-             * @event contextmenu\r
-             * Fires when a template node is right clicked.\r
-             * @param {Ext.DataView} this\r
-             * @param {Number} index The index of the target node\r
-             * @param {HTMLElement} node The target node\r
-             * @param {Ext.EventObject} e The raw event object\r
-             */\r
-            "contextmenu",\r
-            /**\r
-             * @event selectionchange\r
-             * Fires when the selected nodes change.\r
-             * @param {Ext.DataView} this\r
-             * @param {Array} selections Array of the selected nodes\r
-             */\r
-            "selectionchange",\r
-\r
-            /**\r
-             * @event beforeselect\r
-             * Fires before a selection is made. If any handlers return false, the selection is cancelled.\r
-             * @param {Ext.DataView} this\r
-             * @param {HTMLElement} node The node to be selected\r
-             * @param {Array} selections Array of currently selected nodes\r
-             */\r
-            "beforeselect"\r
-        );\r
-\r
-        this.all = new Ext.CompositeElementLite();\r
-        this.selected = new Ext.CompositeElementLite();\r
-    },\r
-\r
-    // private\r
-    onRender : function(){\r
-        if(!this.el){\r
-            this.el = document.createElement('div');\r
-            this.el.id = this.id;\r
-        }\r
-        Ext.DataView.superclass.onRender.apply(this, arguments);\r
-    },\r
-\r
-    // private\r
-    afterRender : function(){\r
-        Ext.DataView.superclass.afterRender.call(this);\r
-\r
-        this.el.on({\r
-            "click": this.onClick,\r
-            "dblclick": this.onDblClick,\r
-            "contextmenu": this.onContextMenu,\r
-            scope:this\r
-        });\r
-\r
-        if(this.overClass || this.trackOver){\r
-            this.el.on({\r
-                "mouseover": this.onMouseOver,\r
-                "mouseout": this.onMouseOut,\r
-                scope:this\r
-            });\r
-        }\r
-\r
-        if(this.store){\r
-            this.setStore(this.store, true);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Refreshes the view by reloading the data from the store and re-rendering the template.\r
-     */\r
-    refresh : function(){\r
-        this.clearSelections(false, true);\r
-        this.el.update("");\r
-        var records = this.store.getRange();\r
-        if(records.length < 1){\r
-            if(!this.deferEmptyText || this.hasSkippedEmptyText){\r
-                this.el.update(this.emptyText);\r
-            }\r
-            this.hasSkippedEmptyText = true;\r
-            this.all.clear();\r
-            return;\r
-        }\r
-        this.tpl.overwrite(this.el, this.collectData(records, 0));\r
-        this.all.fill(Ext.query(this.itemSelector, this.el.dom));\r
-        this.updateIndexes(0);\r
-    },\r
-\r
-    /**\r
-     * Function which can be overridden to provide custom formatting for each Record that is used by this\r
-     * DataView's {@link #tpl template} to render each node.\r
-     * @param {Array/Object} data The raw data object that was used to create the Record.\r
-     * @param {Number} recordIndex the index number of the Record being prepared for rendering.\r
-     * @param {Record} record The Record being prepared for rendering.\r
-     * @return {Array/Object} The formatted data in a format expected by the internal {@link #tpl template}'s overwrite() method.\r
-     * (either an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}))\r
-     */\r
-    prepareData : function(data){\r
-        return data;\r
-    },\r
-\r
-    /**\r
-     * <p>Function which can be overridden which returns the data object passed to this\r
-     * DataView's {@link #tpl template} to render the whole DataView.</p>\r
-     * <p>This is usually an Array of data objects, each element of which is processed by an\r
-     * {@link Ext.XTemplate XTemplate} which uses <tt>'&lt;tpl for="."&gt;'</tt> to iterate over its supplied\r
-     * data object as an Array. However, <i>named</i> properties may be placed into the data object to\r
-     * provide non-repeating data such as headings, totals etc.</p>\r
-     * @param records {Array} An Array of {@link Ext.data.Record}s to be rendered into the DataView.\r
-     * @return {Array} An Array of data objects to be processed by a repeating XTemplate. May also\r
-     * contain <i>named</i> properties.\r
-     */\r
-    collectData : function(records, startIndex){\r
-        var r = [];\r
-        for(var i = 0, len = records.length; i < len; i++){\r
-            r[r.length] = this.prepareData(records[i].data, startIndex+i, records[i]);\r
-        }\r
-        return r;\r
-    },\r
-\r
-    // private\r
-    bufferRender : function(records){\r
-        var div = document.createElement('div');\r
-        this.tpl.overwrite(div, this.collectData(records));\r
-        return Ext.query(this.itemSelector, div);\r
-    },\r
-\r
-    // private\r
-    onUpdate : function(ds, record){\r
-        var index = this.store.indexOf(record);\r
-        var sel = this.isSelected(index);\r
-        var original = this.all.elements[index];\r
-        var node = this.bufferRender([record], index)[0];\r
-\r
-        this.all.replaceElement(index, node, true);\r
-        if(sel){\r
-            this.selected.replaceElement(original, node);\r
-            this.all.item(index).addClass(this.selectedClass);\r
-        }\r
-        this.updateIndexes(index, index);\r
-    },\r
-\r
-    // private\r
-    onAdd : function(ds, records, index){\r
-        if(this.all.getCount() == 0){\r
-            this.refresh();\r
-            return;\r
-        }\r
-        var nodes = this.bufferRender(records, index), n, a = this.all.elements;\r
-        if(index < this.all.getCount()){\r
-            n = this.all.item(index).insertSibling(nodes, 'before', true);\r
-            a.splice.apply(a, [index, 0].concat(nodes));\r
-        }else{\r
-            n = this.all.last().insertSibling(nodes, 'after', true);\r
-            a.push.apply(a, nodes);\r
-        }\r
-        this.updateIndexes(index);\r
-    },\r
-\r
-    // private\r
-    onRemove : function(ds, record, index){\r
-        this.deselect(index);\r
-        this.all.removeElement(index, true);\r
-        this.updateIndexes(index);\r
-    },\r
-\r
-    /**\r
-     * Refreshes an individual node's data from the store.\r
-     * @param {Number} index The item's data index in the store\r
-     */\r
-    refreshNode : function(index){\r
-        this.onUpdate(this.store, this.store.getAt(index));\r
-    },\r
-\r
-    // private\r
-    updateIndexes : function(startIndex, endIndex){\r
-        var ns = this.all.elements;\r
-        startIndex = startIndex || 0;\r
-        endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1));\r
-        for(var i = startIndex; i <= endIndex; i++){\r
-            ns[i].viewIndex = i;\r
-        }\r
-    },\r
-    \r
-    /**\r
-     * Returns the store associated with this DataView.\r
-     * @return {Ext.data.Store} The store\r
-     */\r
-    getStore : function(){\r
-        return this.store;\r
-    },\r
-\r
-    /**\r
-     * Changes the data store bound to this view and refreshes it.\r
-     * @param {Store} store The store to bind to this view\r
-     */\r
-    setStore : function(store, initial){\r
-        if(!initial && this.store){\r
-            this.store.un("beforeload", this.onBeforeLoad, this);\r
-            this.store.un("datachanged", this.refresh, this);\r
-            this.store.un("add", this.onAdd, this);\r
-            this.store.un("remove", this.onRemove, this);\r
-            this.store.un("update", this.onUpdate, this);\r
-            this.store.un("clear", this.refresh, this);\r
-        }\r
-        if(store){\r
-            store = Ext.StoreMgr.lookup(store);\r
-            store.on("beforeload", this.onBeforeLoad, this);\r
-            store.on("datachanged", this.refresh, this);\r
-            store.on("add", this.onAdd, this);\r
-            store.on("remove", this.onRemove, this);\r
-            store.on("update", this.onUpdate, this);\r
-            store.on("clear", this.refresh, this);\r
-        }\r
-        this.store = store;\r
-        if(store){\r
-            this.refresh();\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Returns the template node the passed child belongs to, or null if it doesn't belong to one.\r
-     * @param {HTMLElement} node\r
-     * @return {HTMLElement} The template node\r
-     */\r
-    findItemFromChild : function(node){\r
-        return Ext.fly(node).findParent(this.itemSelector, this.el);\r
-    },\r
-\r
-    // private\r
-    onClick : function(e){\r
-        var item = e.getTarget(this.itemSelector, this.el);\r
-        if(item){\r
-            var index = this.indexOf(item);\r
-            if(this.onItemClick(item, index, e) !== false){\r
-                this.fireEvent("click", this, index, item, e);\r
-            }\r
-        }else{\r
-            if(this.fireEvent("containerclick", this, e) !== false){\r
-                this.clearSelections();\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    onContextMenu : function(e){\r
-        var item = e.getTarget(this.itemSelector, this.el);\r
-        if(item){\r
-            this.fireEvent("contextmenu", this, this.indexOf(item), item, e);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onDblClick : function(e){\r
-        var item = e.getTarget(this.itemSelector, this.el);\r
-        if(item){\r
-            this.fireEvent("dblclick", this, this.indexOf(item), item, e);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onMouseOver : function(e){\r
-        var item = e.getTarget(this.itemSelector, this.el);\r
-        if(item && item !== this.lastItem){\r
-            this.lastItem = item;\r
-            Ext.fly(item).addClass(this.overClass);\r
-            this.fireEvent("mouseenter", this, this.indexOf(item), item, e);\r
-        }\r
-    },\r
-\r
-    // private\r
-    onMouseOut : function(e){\r
-        if(this.lastItem){\r
-            if(!e.within(this.lastItem, true, true)){\r
-                Ext.fly(this.lastItem).removeClass(this.overClass);\r
-                this.fireEvent("mouseleave", this, this.indexOf(this.lastItem), this.lastItem, e);\r
-                delete this.lastItem;\r
-            }\r
-        }\r
-    },\r
-\r
-    // private\r
-    onItemClick : function(item, index, e){\r
-        if(this.fireEvent("beforeclick", this, index, item, e) === false){\r
-            return false;\r
-        }\r
-        if(this.multiSelect){\r
-            this.doMultiSelection(item, index, e);\r
-            e.preventDefault();\r
-        }else if(this.singleSelect){\r
-            this.doSingleSelection(item, index, e);\r
-            e.preventDefault();\r
-        }\r
-        return true;\r
-    },\r
-\r
-    // private\r
-    doSingleSelection : function(item, index, e){\r
-        if(e.ctrlKey && this.isSelected(index)){\r
-            this.deselect(index);\r
-        }else{\r
-            this.select(index, false);\r
-        }\r
-    },\r
-\r
-    // private\r
-    doMultiSelection : function(item, index, e){\r
-        if(e.shiftKey && this.last !== false){\r
-            var last = this.last;\r
-            this.selectRange(last, index, e.ctrlKey);\r
-            this.last = last; // reset the last\r
-        }else{\r
-            if((e.ctrlKey||this.simpleSelect) && this.isSelected(index)){\r
-                this.deselect(index);\r
-            }else{\r
-                this.select(index, e.ctrlKey || e.shiftKey || this.simpleSelect);\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Gets the number of selected nodes.\r
-     * @return {Number} The node count\r
-     */\r
-    getSelectionCount : function(){\r
-        return this.selected.getCount()\r
-    },\r
-\r
-    /**\r
-     * Gets the currently selected nodes.\r
-     * @return {Array} An array of HTMLElements\r
-     */\r
-    getSelectedNodes : function(){\r
-        return this.selected.elements;\r
-    },\r
-\r
-    /**\r
-     * Gets the indexes of the selected nodes.\r
-     * @return {Array} An array of numeric indexes\r
-     */\r
-    getSelectedIndexes : function(){\r
-        var indexes = [], s = this.selected.elements;\r
-        for(var i = 0, len = s.length; i < len; i++){\r
-            indexes.push(s[i].viewIndex);\r
-        }\r
-        return indexes;\r
-    },\r
-\r
-    /**\r
-     * Gets an array of the selected records\r
-     * @return {Array} An array of {@link Ext.data.Record} objects\r
-     */\r
-    getSelectedRecords : function(){\r
-        var r = [], s = this.selected.elements;\r
-        for(var i = 0, len = s.length; i < len; i++){\r
-            r[r.length] = this.store.getAt(s[i].viewIndex);\r
-        }\r
-        return r;\r
-    },\r
-\r
-    /**\r
-     * Gets an array of the records from an array of nodes\r
-     * @param {Array} nodes The nodes to evaluate\r
-     * @return {Array} records The {@link Ext.data.Record} objects\r
-     */\r
-    getRecords : function(nodes){\r
-        var r = [], s = nodes;\r
-        for(var i = 0, len = s.length; i < len; i++){\r
-            r[r.length] = this.store.getAt(s[i].viewIndex);\r
-        }\r
-        return r;\r
-    },\r
-\r
-    /**\r
-     * Gets a record from a node\r
-     * @param {HTMLElement} node The node to evaluate\r
-     * @return {Record} record The {@link Ext.data.Record} object\r
-     */\r
-    getRecord : function(node){\r
-        return this.store.getAt(node.viewIndex);\r
-    },\r
-\r
-    /**\r
-     * Clears all selections.\r
-     * @param {Boolean} suppressEvent (optional) True to skip firing of the selectionchange event\r
-     */\r
-    clearSelections : function(suppressEvent, skipUpdate){\r
-        if((this.multiSelect || this.singleSelect) && this.selected.getCount() > 0){\r
-            if(!skipUpdate){\r
-                this.selected.removeClass(this.selectedClass);\r
-            }\r
-            this.selected.clear();\r
-            this.last = false;\r
-            if(!suppressEvent){\r
-                this.fireEvent("selectionchange", this, this.selected.elements);\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Returns true if the passed node is selected, else false.\r
-     * @param {HTMLElement/Number} node The node or node index to check\r
-     * @return {Boolean} True if selected, else false\r
-     */\r
-    isSelected : function(node){\r
-        return this.selected.contains(this.getNode(node));\r
-    },\r
-\r
-    /**\r
-     * Deselects a node.\r
-     * @param {HTMLElement/Number} node The node to deselect\r
-     */\r
-    deselect : function(node){\r
-        if(this.isSelected(node)){\r
-            node = this.getNode(node);\r
-            this.selected.removeElement(node);\r
-            if(this.last == node.viewIndex){\r
-                this.last = false;\r
-            }\r
-            Ext.fly(node).removeClass(this.selectedClass);\r
-            this.fireEvent("selectionchange", this, this.selected.elements);\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Selects a set of nodes.\r
-     * @param {Array/HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node,\r
-     * id of a template node or an array of any of those to select\r
-     * @param {Boolean} keepExisting (optional) true to keep existing selections\r
-     * @param {Boolean} suppressEvent (optional) true to skip firing of the selectionchange vent\r
-     */\r
-    select : function(nodeInfo, keepExisting, suppressEvent){\r
-        if(Ext.isArray(nodeInfo)){\r
-            if(!keepExisting){\r
-                this.clearSelections(true);\r
-            }\r
-            for(var i = 0, len = nodeInfo.length; i < len; i++){\r
-                this.select(nodeInfo[i], true, true);\r
-            }\r
-               if(!suppressEvent){\r
-                   this.fireEvent("selectionchange", this, this.selected.elements);\r
-               }\r
-        } else{\r
-            var node = this.getNode(nodeInfo);\r
-            if(!keepExisting){\r
-                this.clearSelections(true);\r
-            }\r
-            if(node && !this.isSelected(node)){\r
-                if(this.fireEvent("beforeselect", this, node, this.selected.elements) !== false){\r
-                    Ext.fly(node).addClass(this.selectedClass);\r
-                    this.selected.add(node);\r
-                    this.last = node.viewIndex;\r
-                    if(!suppressEvent){\r
-                        this.fireEvent("selectionchange", this, this.selected.elements);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-    },\r
-\r
-    /**\r
-     * Selects a range of nodes. All nodes between start and end are selected.\r
-     * @param {Number} start The index of the first node in the range\r
-     * @param {Number} end The index of the last node in the range\r
-     * @param {Boolean} keepExisting (optional) True to retain existing selections\r
-     */\r
-    selectRange : function(start, end, keepExisting){\r
-        if(!keepExisting){\r
-            this.clearSelections(true);\r
-        }\r
-        this.select(this.getNodes(start, end), true);\r
-    },\r
-\r
-    /**\r
-     * Gets a template node.\r
-     * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node\r
-     * @return {HTMLElement} The node or null if it wasn't found\r
-     */\r
-    getNode : function(nodeInfo){\r
-        if(typeof nodeInfo == "string"){\r
-            return document.getElementById(nodeInfo);\r
-        }else if(typeof nodeInfo == "number"){\r
-            return this.all.elements[nodeInfo];\r
-        }\r
-        return nodeInfo;\r
-    },\r
-\r
-    /**\r
-     * Gets a range nodes.\r
-     * @param {Number} start (optional) The index of the first node in the range\r
-     * @param {Number} end (optional) The index of the last node in the range\r
-     * @return {Array} An array of nodes\r
-     */\r
-    getNodes : function(start, end){\r
-        var ns = this.all.elements;\r
-        start = start || 0;\r
-        end = typeof end == "undefined" ? Math.max(ns.length - 1, 0) : end;\r
-        var nodes = [], i;\r
-        if(start <= end){\r
-            for(i = start; i <= end && ns[i]; i++){\r
-                nodes.push(ns[i]);\r
-            }\r
-        } else{\r
-            for(i = start; i >= end && ns[i]; i--){\r
-                nodes.push(ns[i]);\r
-            }\r
-        }\r
-        return nodes;\r
-    },\r
-\r
-    /**\r
-     * Finds the index of the passed node.\r
-     * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node\r
-     * @return {Number} The index of the node or -1\r
-     */\r
-    indexOf : function(node){\r
-        node = this.getNode(node);\r
-        if(typeof node.viewIndex == "number"){\r
-            return node.viewIndex;\r
-        }\r
-        return this.all.indexOf(node);\r
-    },\r
-\r
-    // private\r
-    onBeforeLoad : function(){\r
-        if(this.loadingText){\r
-            this.clearSelections(false, true);\r
-            this.el.update('<div class="loading-indicator">'+this.loadingText+'</div>');\r
-            this.all.clear();\r
-        }\r
-    },\r
-\r
-    onDestroy : function(){\r
-        Ext.DataView.superclass.onDestroy.call(this);\r
-        this.setStore(null);\r
-    }\r
-});\r
-\r
-Ext.reg('dataview', Ext.DataView);
\ No newline at end of file