X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/docs/source/DataView.html diff --git a/docs/source/DataView.html b/docs/source/DataView.html index 3dcd4b28..6cb6aca3 100644 --- a/docs/source/DataView.html +++ b/docs/source/DataView.html @@ -1,11 +1,17 @@ - - - The source code - - - - -
/** + + + The source code + + + + +
/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+
/** * @class Ext.DataView * @extends Ext.BoxComponent * A mechanism for displaying data using custom layout templates and formatting. DataView uses an {@link Ext.XTemplate} @@ -318,16 +324,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]; - - this.all.replaceElement(index, node, true); - if(sel){ - this.selected.replaceElement(original, node); - this.all.item(index).addClass(this.selectedClass); + 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.updateIndexes(index, index); } - this.updateIndexes(index, index); }, // private @@ -389,14 +397,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){ @@ -747,6 +759,6 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, { */ Ext.DataView.prototype.setStore = Ext.DataView.prototype.bindStore; -Ext.reg('dataview', Ext.DataView);
- +Ext.reg('dataview', Ext.DataView);
+ \ No newline at end of file