details:   https://code.openbravo.com/erp/devel/pi/rev/de48663576d7
changeset: 17706:de48663576d7
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Mon Aug 20 12:02:56 2012 +0200
summary:   Fixes issue 21375: Field is updated even if not visible in grid

When a row is being edited in the grid, if there is a callout and the changed 
column is not displayed in the grid, its value was not being updated.

This has been fixed by modifying the setItemValue function of ob-view-form, so 
that it now takes into account that a field not being shown in the grid might 
be updated.

diffstat:

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

diffs (33 lines):

diff -r f663cbc1d3c9 -r de48663576d7 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Mon Aug 20 09:33:20 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Mon Aug 20 12:02:56 2012 +0200
@@ -1116,12 +1116,28 @@
 
   // calls setValue and the onchange handling
   setItemValue: function (item, value) {
-    var currentValue, view;
+    var currentValue, view, isGridItem, completeFieldsLength, i;
 
     if (isc.isA.String(item)) {
 
       // not an item, set and bail
       if (!this.getField(item)) {
+        // It might be a column that is not being displayed in the grid
+        if (!this.view.isShowingForm && this.grid) {
+          // check if the item is included in the complete fields of the grid
+          // see issue https://issues.openbravo.com/view.php?id=21375
+          isGridItem = false;
+          completeFieldsLength = this.grid.completeFields;
+          for (i = 0; i < completeFieldsLength; i++) {
+            if (item === this.grid.completeFields[i].name) {
+              isGridItem = true;
+              break;
+            }
+          }
+          if (isGridItem) {
+            this.grid.setEditValue(this.grid.getEditRow(), item, value);
+          }
+        }
         this.setValue(item, value);
         return;
       }

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to