details:   /erp/devel/pi/rev/8cdd13d71e6e
changeset: 11234:8cdd13d71e6e
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Mar 14 18:47:56 2011 +0100
summary:   Solve js undefined error

details:   /erp/devel/pi/rev/2da43a25ebc4
changeset: 11235:2da43a25ebc4
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Mar 14 18:48:20 2011 +0100
summary:   Fixes issue 16254: Grid editing: when editing a row with an error 
the focus should go to the error field

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
 |   4 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  16 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 1a363220dac7 -r 2da43a25ebc4 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Mon Mar 14 18:31:31 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Mon Mar 14 18:48:20 2011 +0100
@@ -495,7 +495,9 @@
       }
       this.grid.setEditValues(this.grid.getEditRow(), this.getValues(), true);
       this.grid.storeUpdatedEditorValue(true);
-      editValues.actionAfterFicReturn = tmpActionAfterFic;
+      if (editValues) {
+        editValues.actionAfterFicReturn = tmpActionAfterFic;
+      }
     }
 
     this.setDisabled(false);
diff -r 1a363220dac7 -r 2da43a25ebc4 
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
  Mon Mar 14 18:31:31 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Mon Mar 14 18:48:20 2011 +0100
@@ -1260,8 +1260,22 @@
     return this.getSelection();
   },
   
-  // +++++++++++++++++ functions for the editing +++++++++++++++++
+  // +++++++++++++++++ functions for grid editing +++++++++++++++++
   
+  startEditing: function (rowNum, colNum, suppressFocus, eCe, suppressWarning) 
{
+    // if a row is set and not a col then check if we should focus in the
+    // first error field
+    if ((rowNum || rowNum === 0) && (!colNum && colNum !== 0) && 
this.rowHasErrors(rowNum))  {
+      for (var i = 0; i < this.getFields().length; i++) {
+        if (this.cellHasErrors(rowNum, i)) {
+         colNum = i;
+         break; 
+        }        
+      }
+    }
+    return this.Super('startEditing', [rowNum, colNum, suppressFocus, eCe, 
suppressWarning]);
+  },
+
   startEditingNew: function(rowNum){
     var insertRow;
     if (rowNum || rowNum === 0) {

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to