Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / source / CellEditing.html
index f04e2e7..6d449e8 100644 (file)
@@ -79,7 +79,7 @@
 Ext.define('Ext.grid.plugin.CellEditing', {
     alias: 'plugin.cellediting',
     extend: 'Ext.grid.plugin.Editing',
-    requires: ['Ext.grid.CellEditor'],
+    requires: ['Ext.grid.CellEditor', 'Ext.util.DelayedTask'],
 
     constructor: function() {
 <span id='Ext-grid-plugin-CellEditing-event-beforeedit'>        /**
@@ -162,6 +162,12 @@ grid.on('validateedit', function(e) {
         this.editors = Ext.create('Ext.util.MixedCollection', false, function(editor) {
             return editor.editorId;
         });
+        this.editTask = Ext.create('Ext.util.DelayedTask');
+    },
+    
+    onReconfigure: function(){
+        this.editors.clear();
+        this.callParent();    
     },
 
 <span id='Ext-grid-plugin-CellEditing-method-destroy'>    /**
@@ -170,6 +176,7 @@ grid.on('validateedit', function(e) {
      */
     destroy: function() {
         var me = this;
+        me.editTask.cancel();
         me.editors.each(Ext.destroy, Ext);
         me.editors.clear();
         me.callParent(arguments);
@@ -238,13 +245,13 @@ grid.on('validateedit', function(e) {
             me.setActiveColumn(columnHeader);
 
             // Defer, so we have some time between view scroll to sync up the editor
-            Ext.defer(ed.startEdit, 15, ed, [me.getCell(record, columnHeader), value]);
+            me.editTask.delay(15, ed.startEdit, ed, [me.getCell(record, columnHeader), value]);
         } else {
             // BrowserBug: WebKit &amp; IE refuse to focus the element, rather
             // it will focus it and then immediately focus the body. This
             // temporary hack works for Webkit and IE6. IE7 and 8 are still
             // broken
-            me.grid.getView().el.focus((Ext.isWebKit || Ext.isIE) ? 10 : false);
+            me.grid.getView().getEl(columnHeader).focus((Ext.isWebKit || Ext.isIE) ? 10 : false);
         }
     },
 
@@ -283,7 +290,7 @@ grid.on('validateedit', function(e) {
     getEditor: function(record, column) {
         var me = this,
             editors = me.editors,
-            editorId = column.itemId || column.id,
+            editorId = column.getItemId(),
             editor = editors.getByKey(editorId);
 
         if (editor) {
@@ -360,7 +367,7 @@ grid.on('validateedit', function(e) {
                 me.context.record.set(dataIndex, value);
             // Restore focus back to the view's element.
             } else {
-                grid.getView().el.focus();
+                grid.getView().getEl(activeColumn).focus();
             }
             me.context.value = value;
             me.fireEvent('edit', me, me.context);
@@ -375,7 +382,7 @@ grid.on('validateedit', function(e) {
     cancelEdit: function() {
         var me = this,
             activeEd = me.getActiveEditor(),
-            viewEl = me.grid.getView().el;
+            viewEl = me.grid.getView().getEl(me.getActiveColumn());
 
         me.setActiveEditor(null);
         me.setActiveColumn(null);