allow string based values for comboboxarray
[roojs1] / Roo / grid / EditorGrid.js
index 89f05ce..5f24699 100644 (file)
@@ -117,6 +117,9 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
             cancel:false,
             editor: ed
         };
+        var cell = Roo.get(this.view.getCell(ed.row,ed.col));
+        cell.show();
+          
         if(String(value) !== String(startValue)){
             
             if(this.fireEvent("validateedit", e) !== false && !e.cancel){
@@ -145,8 +148,10 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
         this.stopEditing();
         if(this.colModel.isCellEditable(col, row)){
             this.view.ensureVisible(row, col, true);
+          
             var r = this.dataSource.getAt(row);
             var field = this.colModel.getDataIndex(col);
+            var cell = Roo.get(this.view.getCell(row,col));
             var e = {
                 grid: this,
                 record: r,
@@ -154,7 +159,7 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
                 value: r.data[field],
                 row: row,
                 column: col,
-                cancel:false
+                cancel:false 
             };
             if(this.fireEvent("beforeedit", e) !== false && !e.cancel){
                 this.editing = true;
@@ -167,12 +172,15 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
                     ed.render(ed.parentEl || document.body);
                 }
                 ed.field.reset();
+               
+                cell.hide();
+                
                 (function(){ // complex but required for focus issues in safari, ie and opera
                     ed.row = row;
                     ed.col = col;
                     ed.record = r;
-                    ed.on("complete", this.onEditComplete, this, {single: true});
-                    ed.on("specialkey", this.selModel.onEditorKey, this.selModel);
+                    ed.on("complete",   this.onEditComplete,        this,       {single: true});
+                    ed.on("specialkey", this.selModel.onEditorKey,  this.selModel);
                     this.activeEditor = ed;
                     var v = r.data[field];
                     ed.startEdit(this.view.getCell(row, col), v);
@@ -195,5 +203,15 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
             this.activeEditor.completeEdit();
         }
         this.activeEditor = null;
+    },
+       
+        /**
+     * Called to get grid's drag proxy text, by default returns this.ddText.
+     * @return {String}
+     */
+    getDragDropText : function(){
+        var count = this.selModel.getSelectedCell() ? 1 : 0;
+        return String.format(this.ddText, count, count == 1 ? '' : 's');
     }
+       
 });
\ No newline at end of file