X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/pkgs/data-list-views-debug.js diff --git a/pkgs/data-list-views-debug.js b/pkgs/data-list-views-debug.js index ec0ac8eb..c5364df8 100644 --- a/pkgs/data-list-views-debug.js +++ b/pkgs/data-list-views-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.0.0 + * Ext JS Library 3.1.0 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license @@ -154,7 +154,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { "click", /** * @event mouseenter - * Fires when the mouse enters a template node. trackOver:true or an overCls must be set to enable this event. + * Fires when the mouse enters a template node. trackOver:true or an overClass must be set to enable this event. * @param {Ext.DataView} this * @param {Number} index The index of the target node * @param {HTMLElement} node The target node @@ -163,7 +163,7 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { "mouseenter", /** * @event mouseleave - * Fires when the mouse leaves a template node. trackOver:true or an overCls must be set to enable this event. + * Fires when the mouse leaves a template node. trackOver:true or an overClass must be set to enable this event. * @param {Ext.DataView} this * @param {Number} index The index of the target node * @param {HTMLElement} node The target node @@ -317,16 +317,18 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { // private onUpdate : function(ds, record){ var index = this.store.indexOf(record); - var sel = this.isSelected(index); - var original = this.all.elements[index]; - var node = this.bufferRender([record], index)[0]; + if(index > -1){ + var sel = this.isSelected(index); + var original = this.all.elements[index]; + var node = this.bufferRender([record], index)[0]; - this.all.replaceElement(index, node, true); - if(sel){ - this.selected.replaceElement(original, node); - this.all.item(index).addClass(this.selectedClass); + this.all.replaceElement(index, node, true); + if(sel){ + this.selected.replaceElement(original, node); + this.all.item(index).addClass(this.selectedClass); + } + this.updateIndexes(index, index); } - this.updateIndexes(index, index); }, // private @@ -388,14 +390,18 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { */ bindStore : function(store, initial){ if(!initial && this.store){ - this.store.un("beforeload", this.onBeforeLoad, this); - this.store.un("datachanged", this.refresh, this); - this.store.un("add", this.onAdd, this); - this.store.un("remove", this.onRemove, this); - this.store.un("update", this.onUpdate, this); - this.store.un("clear", this.refresh, this); if(store !== this.store && this.store.autoDestroy){ this.store.destroy(); + }else{ + this.store.un("beforeload", this.onBeforeLoad, this); + this.store.un("datachanged", this.refresh, this); + this.store.un("add", this.onAdd, this); + this.store.un("remove", this.onRemove, this); + this.store.un("update", this.onUpdate, this); + this.store.un("clear", this.refresh, this); + } + if(!store){ + this.store = null; } } if(store){ @@ -735,6 +741,8 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { }, onDestroy : function(){ + this.all.clear(); + this.selected.clear(); Ext.DataView.superclass.onDestroy.call(this); this.bindStore(null); } @@ -746,10 +754,11 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { */ Ext.DataView.prototype.setStore = Ext.DataView.prototype.bindStore; -Ext.reg('dataview', Ext.DataView);/** - * @class Ext.ListView +Ext.reg('dataview', Ext.DataView); +/** + * @class Ext.list.ListView * @extends Ext.DataView - *

Ext.ListView is a fast and light-weight implentation of a + *

Ext.list.ListView is a fast and light-weight implentation of a * {@link Ext.grid.GridPanel Grid} like view with the following characteristics:

*