X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/DataView.html?ds=sidebyside
diff --git a/docs/source/DataView.html b/docs/source/DataView.html
index 3dcd4b28..44c9582b 100644
--- a/docs/source/DataView.html
+++ b/docs/source/DataView.html
@@ -1,5 +1,6 @@
+
The source code
@@ -155,7 +156,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
@@ -164,7 +165,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
@@ -318,16 +319,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 +392,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){
@@ -736,6 +743,8 @@ Ext.DataView = Ext.extend(Ext.BoxComponent, {
},
onDestroy : function(){
+ this.all.clear();
+ this.selected.clear();
Ext.DataView.superclass.onDestroy.call(this);
this.bindStore(null);
}
@@ -747,6 +756,7 @@ 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