roojs-ui-debug.js
authorAlan Knowles <alan@akbkhome.com>
Mon, 26 Sep 2011 04:40:34 +0000 (12:40 +0800)
committerAlan Knowles <alan@akbkhome.com>
Mon, 26 Sep 2011 04:40:34 +0000 (12:40 +0800)
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui-debug.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-ui.js
roojs-debug.js
roojs-all.js

roojs-all.js
roojs-debug.js

index 2e8e9fb..6816db2 100644 (file)
@@ -950,8 +950,7 @@ this.fireEvent("rowselect",this,A,r);this.fireEvent("selectionchange",this);}},d
 this.fireEvent("rowdeselect",this,A);this.fireEvent("selectionchange",this);},restoreLast:function(){if(this._last){this.last=this._last;}},acceptsNav:function(A,B,cm){return !cm.isHidden(B)&&cm.isCellEditable(B,A);},onEditorKey:function(A,e){var k=e.getKey(),B,g=this.grid,ed=g.activeEditor;if(k==e.TAB){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else {B=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}}else if(k==e.ENTER&&!e.ctrlKey){e.stopEvent();ed.completeEdit();if(e.shiftKey){B=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this);}else {B=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this);}}else if(k==e.ESC){ed.cancelEdit();}if(B){g.startEditing(B[0],B[1]);}}});
 Roo.grid.CellSelectionModel=function(A){Roo.apply(this,A);this.selection=null;this.addEvents({"beforecellselect":true,"cellselect":true,"selectionchange":true});Roo.grid.CellSelectionModel.superclass.constructor.call(this);};Roo.extend(Roo.grid.CellSelectionModel,Roo.grid.AbstractSelectionModel,{initEvents:function(){this.grid.on("mousedown",this.handleMouseDown,this);this.grid.getGridEl().on(Roo.isIE?"keydown":"keypress",this.handleKeyDown,this);var A=this.grid.view;A.on("refresh",this.onViewChange,this);A.on("rowupdated",this.onRowUpdated,this);A.on("beforerowremoved",this.clearSelections,this);A.on("beforerowsinserted",this.clearSelections,this);if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this);}},beforeEdit:function(e){this.select(e.row,e.column,false,true,e.record);},onRowUpdated:function(v,A,r){if(this.selection&&this.selection.record==r){v.onCellSelect(A,this.selection.cell[1]);}},onViewChange:function(){this.clearSelections(true);},getSelectedCell:function(){return this.selection?this.selection.cell:null;},clearSelections:function(A){var s=this.selection;if(s){if(A!==true){this.grid.view.onCellDeselect(s.cell[0],s.cell[1]);}
 this.selection=null;this.fireEvent("selectionchange",this,null);}},hasSelection:function(){return this.selection?true:false;},handleMouseDown:function(e,t){var v=this.grid.getView();if(this.isLocked()){return;};var A=v.findRowIndex(t);var B=v.findCellIndex(t);if(A!==false&&B!==false){this.select(A,B);}},select:function(A,B,C,D,r){if(this.fireEvent("beforecellselect",this,A,B)!==false){this.clearSelections();r=r||this.grid.dataSource.getAt(A);this.selection={record:r,cell:[A,B]};if(!C){var v=this.grid.getView();v.onCellSelect(A,B);if(D!==true){v.focusCell(A,B);}}
-this.fireEvent("cellselect",this,A,B);this.fireEvent("selectionchange",this,this.selection);}},isSelectable:function(A,B,cm){return !cm.isHidden(B);},handleKeyDown:function(e){Roo.log('Cell Sel Model handleKeyDown');if(!e.isNavKeyPress()){return;}var g=this.grid,s=this.selection;if(!s){e.stopEvent();var A=g.walkCells(0,0,1,this.isSelectable,this);if(A){this.select(A[0],A[1]);}return;}var sm=this;var B=function(D,E,F){return g.walkCells(D,E,F,sm.isSelectable,sm);};var k=e.getKey(),r=s.cell[0],c=s.cell[1];var C;switch(k){case e.TAB:if(g.isEditor&&g.editing){return;}if(e.shiftKey){C=B(r,c-1,-1);}else {C=B(r,c+1,1);}break;case e.DOWN:C=B(r+1,c,1);break;case e.UP:C=B(r-1,c,-1);break;case e.RIGHT:C=B(r,c+1,1);break;case e.LEFT:C=B(r,c-1,-1);break;case e.ENTER:if(g.isEditor&&!g.editing){g.startEditing(r,c);e.stopEvent();return;}break;};if(C){this.select(C[0],C[1]);e.stopEvent();}},acceptsNav:function(A,B,cm){return !cm.isHidden(B)&&cm.isCellEditable(B,A);},onEditorKey:function(A,e){Roo.log("on Editor Key");var k=e.getKey(),B,g=this.grid,ed=g.activeEditor;if(k==e.TAB){if(e.shiftKey){B=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else {B=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}
-e.stopEvent();}else if(k==e.ENTER&&!e.ctrlKey){ed.completeEdit();e.stopEvent();B=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}else if(k==e.ESC){ed.cancelEdit();}if(B){g.startEditing.defer(100,g,[B[0],B[1]]);}}});
+this.fireEvent("cellselect",this,A,B);this.fireEvent("selectionchange",this,this.selection);}},isSelectable:function(A,B,cm){return !cm.isHidden(B);},handleKeyDown:function(e){if(!e.isNavKeyPress()){return;}var g=this.grid,s=this.selection;if(!s){e.stopEvent();var A=g.walkCells(0,0,1,this.isSelectable,this);if(A){this.select(A[0],A[1]);}return;}var sm=this;var B=function(D,E,F){return g.walkCells(D,E,F,sm.isSelectable,sm);};var k=e.getKey(),r=s.cell[0],c=s.cell[1];var C;switch(k){case e.TAB:if(g.isEditor&&g.editing){return;}if(e.shiftKey){C=B(r,c-1,-1);}else {C=B(r,c+1,1);}break;case e.DOWN:C=B(r+1,c,1);break;case e.UP:C=B(r-1,c,-1);break;case e.RIGHT:C=B(r,c+1,1);break;case e.LEFT:C=B(r,c-1,-1);break;case e.ENTER:if(g.isEditor&&!g.editing){g.startEditing(r,c);e.stopEvent();return;}break;};if(C){this.select(C[0],C[1]);e.stopEvent();}},acceptsNav:function(A,B,cm){return !cm.isHidden(B)&&cm.isCellEditable(B,A);},onEditorKey:function(A,e,B){var k=B||e.getKey(),C,g=this.grid,ed=g.activeEditor;if(k==e.TAB){if(e&&e.shiftKey){C=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this);}else {C=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}if(e){e.stopEvent();}}else if(k==e.ENTER&&e&&!e.ctrlKey){ed.completeEdit();e.stopEvent();C=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this);}else if(k==e.ESC){ed.cancelEdit();}if(C){g.startEditing.defer(100,g,[C[0],C[1]]);}}});
 Roo.grid.EditorGrid=function(A,B){Roo.grid.EditorGrid.superclass.constructor.call(this,A,B);this.getGridEl().addClass("xedit-grid");if(!this.selModel){this.selModel=new Roo.grid.CellSelectionModel();}
 this.activeEditor=null;this.addEvents({"beforeedit":true,"afteredit":true,"validateedit":true});this.on("bodyscroll",this.stopEditing,this);this.on(this.clicksToEdit==1?"cellclick":"celldblclick",this.onCellDblClick,this);};Roo.extend(Roo.grid.EditorGrid,Roo.grid.Grid,{clicksToEdit:2,isEditor:true,trackMouseOver:false,onCellDblClick:function(g,A,B){this.startEditing(A,B);},onEditComplete:function(ed,A,B){this.editing=false;this.activeEditor=null;ed.un("specialkey",this.selModel.onEditorKey,this.selModel);var r=ed.record;var C=this.colModel.getDataIndex(ed.col);var e={grid:this,record:r,field:C,originalValue:B,value:A,row:ed.row,column:ed.col,cancel:false,editor:ed};if(String(A)!==String(B)){if(this.fireEvent("validateedit",e)!==false&&!e.cancel){r.set(C,e.value);if(ed.field.displayField&&ed.field.name){r.set(ed.field.name,ed.field.el.dom.value);}delete e.cancel;this.fireEvent("afteredit",e);}}else {this.fireEvent("afteredit",e);}
 this.view.focusCell(ed.row,ed.col);},startEditing:function(A,B){this.stopEditing();if(this.colModel.isCellEditable(B,A)){this.view.ensureVisible(A,B,true);var r=this.dataSource.getAt(A);var C=this.colModel.getDataIndex(B);var e={grid:this,record:r,field:C,value:r.data[C],row:A,column:B,cancel:false};if(this.fireEvent("beforeedit",e)!==false&&!e.cancel){this.editing=true;var ed=this.colModel.getCellEditor(B,A);if(!ed){return;}if(!ed.rendered){ed.render(ed.parentEl||document.body);}
index e45c450..53104aa 100644 (file)
@@ -51162,7 +51162,7 @@ Roo.extend(Roo.grid.CellSelectionModel, Roo.grid.AbstractSelectionModel,  {
 
     /** @ignore */
     handleKeyDown : function(e){
-        Roo.log('Cell Sel Model handleKeyDown');
+        //Roo.log('Cell Sel Model handleKeyDown');
         if(!e.isNavKeyPress()){
             return;
         }
@@ -51224,19 +51224,21 @@ Roo.extend(Roo.grid.CellSelectionModel, Roo.grid.AbstractSelectionModel,  {
         return !cm.isHidden(col) && cm.isCellEditable(col, row);
     },
 
-    onEditorKey : function(field, e){
-        Roo.log("on Editor Key");
-        var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
+    onEditorKey : function(field, e, fakeKey){
+        
+        var k = fakeKey || e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
         ///Roo.log('onEditorKey' + k);
         
         if(k == e.TAB){
-            if(e.shiftKey){
+            if(e && e.shiftKey){
                 newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
             }else{
                 newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
             }
-            e.stopEvent();
-        }else if(k == e.ENTER && !e.ctrlKey){
+            if (e) {
+                e.stopEvent();
+            }
+        }else if(k == e.ENTER && e && !e.ctrlKey){
             ed.completeEdit();
             e.stopEvent();
             newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
@@ -51423,8 +51425,8 @@ Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
                     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);