Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / pkgs / pkg-grid-editor-debug.js
index 11dde46..15ec118 100644 (file)
@@ -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
  * Copyright(c) 2006-2009 Ext JS, LLC
  * licensing@extjs.com
  * http://www.extjs.com/license
  * @constructor
  * @param {Object} config The object containing the configuration of this model.
  */
  * @constructor
  * @param {Object} config The object containing the configuration of this model.
  */
-Ext.grid.CellSelectionModel = function(config){
-    Ext.apply(this, config);
-
-    this.selection = null;
-
-    this.addEvents(
-        /**
-            * @event beforecellselect
-            * Fires before a cell is selected, return false to cancel the selection.
-            * @param {SelectionModel} this
-            * @param {Number} rowIndex The selected row index
-            * @param {Number} colIndex The selected cell index
-            */
-           "beforecellselect",
-        /**
-            * @event cellselect
-            * Fires when a cell is selected.
-            * @param {SelectionModel} this
-            * @param {Number} rowIndex The selected row index
-            * @param {Number} colIndex The selected cell index
-            */
-           "cellselect",
-        /**
-            * @event selectionchange
-            * Fires when the active selection changes.
-            * @param {SelectionModel} this
-            * @param {Object} selection null for no selection or an object with two properties
-         * <div class="mdetail-params"><ul>
-         * <li><b>cell</b> : see {@link #getSelectedCell} 
-         * <li><b>record</b> : Ext.data.record<p class="sub-desc">The {@link Ext.data.Record Record}
-         * which provides the data for the row containing the selection</p></li>
-         * </ul></div>
-            */
-           "selectionchange"
-    );
-
-    Ext.grid.CellSelectionModel.superclass.constructor.call(this);
-};
+Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel,  {
+    
+    constructor : function(config){
+        Ext.apply(this, config);
 
 
-Ext.extend(Ext.grid.CellSelectionModel, Ext.grid.AbstractSelectionModel,  {
+           this.selection = null;
+       
+           this.addEvents(
+               /**
+                * @event beforecellselect
+                * Fires before a cell is selected, return false to cancel the selection.
+                * @param {SelectionModel} this
+                * @param {Number} rowIndex The selected row index
+                * @param {Number} colIndex The selected cell index
+                */
+               "beforecellselect",
+               /**
+                * @event cellselect
+                * Fires when a cell is selected.
+                * @param {SelectionModel} this
+                * @param {Number} rowIndex The selected row index
+                * @param {Number} colIndex The selected cell index
+                */
+               "cellselect",
+               /**
+                * @event selectionchange
+                * Fires when the active selection changes.
+                * @param {SelectionModel} this
+                * @param {Object} selection null for no selection or an object with two properties
+                * <div class="mdetail-params"><ul>
+                * <li><b>cell</b> : see {@link #getSelectedCell} 
+                * <li><b>record</b> : Ext.data.record<p class="sub-desc">The {@link Ext.data.Record Record}
+                * which provides the data for the row containing the selection</p></li>
+                * </ul></div>
+                */
+               "selectionchange"
+           );
+       
+           Ext.grid.CellSelectionModel.superclass.constructor.call(this);
+    },
 
     /** @ignore */
     initEvents : function(){
 
     /** @ignore */
     initEvents : function(){
@@ -443,6 +443,14 @@ grid.on('validateedit', function(e) {
             this.on('celldblclick', this.onCellDblClick, this);
         }
     },
             this.on('celldblclick', this.onCellDblClick, this);
         }
     },
+    
+    onResize : function(){
+        Ext.grid.EditorGridPanel.superclass.onResize.apply(this, arguments);
+        var ae = this.activeEditor;
+        if(this.editing && ae){
+            ae.realign(true);
+        }
+    },
 
     // private
     onCellDblClick : function(g, row, col){
 
     // private
     onCellDblClick : function(g, row, col){
@@ -454,8 +462,8 @@ grid.on('validateedit', function(e) {
         if(e.button !== 0){
             return;
         }
         if(e.button !== 0){
             return;
         }
-        var row = this.view.findRowIndex(t);
-        var col = this.view.findCellIndex(t);
+        var row = this.view.findRowIndex(t),
+            col = this.view.findCellIndex(t);
         if(row !== false && col !== false){
             this.stopEditing();
             if(this.selModel.getSelectedCell){ // cell sm
         if(row !== false && col !== false){
             this.stopEditing();
             if(this.selModel.getSelectedCell){ // cell sm
@@ -476,8 +484,8 @@ grid.on('validateedit', function(e) {
         this.editing = false;
         this.activeEditor = null;
         
         this.editing = false;
         this.activeEditor = null;
         
-               var r = ed.record;
-        var field = this.colModel.getDataIndex(ed.col);
+               var r = ed.record,
+            field = this.colModel.getDataIndex(ed.col);
         value = this.postEditValue(value, startValue, r, field);
         if(this.forceValidation === true || String(value) !== String(startValue)){
             var e = {
         value = this.postEditValue(value, startValue, r, field);
         if(this.forceValidation === true || String(value) !== String(startValue)){
             var e = {
@@ -508,17 +516,17 @@ grid.on('validateedit', function(e) {
         this.stopEditing();
         if(this.colModel.isCellEditable(col, row)){
             this.view.ensureVisible(row, col, true);
         this.stopEditing();
         if(this.colModel.isCellEditable(col, row)){
             this.view.ensureVisible(row, col, true);
-            var r = this.store.getAt(row);
-            var field = this.colModel.getDataIndex(col);
-            var e = {
-                grid: this,
-                record: r,
-                field: field,
-                value: r.data[field],
-                row: row,
-                column: col,
-                cancel:false
-            };
+            var r = this.store.getAt(row),
+                field = this.colModel.getDataIndex(col),
+                e = {
+                    grid: this,
+                    record: r,
+                    field: field,
+                    value: r.data[field],
+                    row: row,
+                    column: col,
+                    cancel:false
+                };
             if(this.fireEvent("beforeedit", e) !== false && !e.cancel){
                 this.editing = true;
                 var ed = this.colModel.getCellEditor(col, row);
             if(this.fireEvent("beforeedit", e) !== false && !e.cancel){
                 this.editing = true;
                 var ed = this.colModel.getCellEditor(col, row);