details:   /erp/devel/pi/rev/4eaf916d4601
changeset: 11643:4eaf916d4601
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Fri Apr 22 17:09:47 2011 +0200
summary:   Solve incorrect focus when moving to next row with arrow key, solved 
wrong decl of local var

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  17 +++++++--
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (56 lines):

diff -r c0b245f3ff82 -r 4eaf916d4601 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Fri Apr 22 14:09:57 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Fri Apr 22 17:09:47 2011 +0200
@@ -1538,6 +1538,15 @@
     } else {
       ret = this.Super('getNextEditCell', arguments);
     }
+        
+    // when moving between rows with the arrow keys, force the focus in the 
correct 
+    // column
+    if (ret && ret[0] !== rowNum && this.getField(colNum) && 
+          (editCompletionEvent === isc.ListGrid.UP_ARROW_KEYPRESS || 
+              editCompletionEvent === isc.ListGrid.DOWN_ARROW_KEYPRESS)) {
+      this.forceFocusColumn = this.getField(colNum).name;
+    }
+    
     delete this._inGetNextEditCell;
     return ret;
   },
@@ -1896,7 +1905,7 @@
   
   createRecordComponent: function(record, colNum){
     if (this.isEditLinkColumn(colNum)) {
-      layout = isc.OBGridButtonsComponent.create({
+      var layout = isc.OBGridButtonsComponent.create({
         record: record,
         grid: this
       });
@@ -2044,8 +2053,8 @@
       this.buttonSeparator1.visibility = 'hidden';
     }
     
+    this.addMembers([formButton, this.buttonSeparator1, this.editButton]);
     this.Super('initWidget', arguments);
-    this.addMembers([formButton, this.buttonSeparator1, this.editButton]);
   },
   
   addSaveCancelProgressButtons: function() {
@@ -2156,7 +2165,7 @@
   
   hideMember: function(memberNo) {
     // already hidden
-    if (this.members[memberNo].visibility === isc.Canvas.HIDDEN) {
+    if (this.members[memberNo] && this.members[memberNo].visibility === 
isc.Canvas.HIDDEN) {
       return;
     }
     this.Super('hideMember', arguments);
@@ -2164,7 +2173,7 @@
 
   showMember: function(memberNo) {
     // already visible
-    if (this.members[memberNo].visibility === isc.Canvas.INHERIT || 
this.members[memberNo].visibility === isc.Canvas.VISIBLE) {
+    if (this.members[memberNo] && this.members[memberNo].visibility === 
isc.Canvas.INHERIT || this.members[memberNo].visibility === isc.Canvas.VISIBLE) 
{
       return;
     }
     this.Super('showMember', arguments);

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to