X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/src/widgets/tree/TreeEditor.js diff --git a/src/widgets/tree/TreeEditor.js b/src/widgets/tree/TreeEditor.js index 4f7065cd..4de8802b 100644 --- a/src/widgets/tree/TreeEditor.js +++ b/src/widgets/tree/TreeEditor.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.0.3 + * Ext JS Library 3.1.0 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license @@ -69,12 +69,18 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { editDelay : 350, initEditor : function(tree){ - tree.on('beforeclick', this.beforeNodeClick, this); - tree.on('dblclick', this.onNodeDblClick, this); - this.on('complete', this.updateNode, this); - this.on('beforestartedit', this.fitToTree, this); + tree.on({ + scope: this, + beforeclick: this.beforeNodeClick, + dblclick: this.onNodeDblClick + }); + this.on({ + scope: this, + complete: this.updateNode, + beforestartedit: this.fitToTree, + specialkey: this.onSpecialKey + }); this.on('startedit', this.bindScroll, this, {delay:10}); - this.on('specialkey', this.onSpecialKey, this); }, // private @@ -156,5 +162,13 @@ Ext.extend(Ext.tree.TreeEditor, Ext.Editor, { e.stopEvent(); this.completeEdit(); } + }, + + onDestroy : function(){ + clearTimeout(this.autoEditTimer); + Ext.tree.TreeEditor.superclass.onDestroy.call(this); + var tree = this.tree; + tree.un('beforeclick', this.beforeNodeClick, this); + tree.un('dblclick', this.onNodeDblClick, this); } }); \ No newline at end of file