Issue 19728: Format js files org.openbravo.client.application - grid
authorIván Perdomo <ivan.perdomo@openbravo.com>
Sat, 11 Feb 2012 15:48:44 +0100
changeset 15464 345215765c33
parent 15463 d3d34b7bf993
child 15465 ba67efc3203a
Issue 19728: Format js files org.openbravo.client.application - grid
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Sat Feb 11 15:28:57 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Sat Feb 11 15:48:44 2012 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2012 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -24,68 +24,70 @@
 isc.OBGrid.addProperties({
 
   dragTrackerMode: 'none',
-  
+
   // recycle gives better performance but also results
   // in strange results that not all record components are
   // drawn when scrolling very fast
   recordComponentPoolingMode: 'viewport',
-  
+
   showRecordComponentsByCell: true,
   recordComponentPosition: 'within',
   poolComponentsPerColumn: true,
   showRecordComponents: true,
   escapeHTML: true,
   bodyProperties: {
-    canSelectText:true,
- 
+    canSelectText: true,
+
     // the redraw on change should not only redraw the current item
     // but the whole edit row, make sure that happens asynchronously
-    redrawFormItem: function(item, reason) {
-      var lg = this.grid, row = lg.getEditRow(), 
-        col = lg.getColNum(item.getFieldName());
-      
+    redrawFormItem: function (item, reason) {
+      var lg = this.grid,
+          row = lg.getEditRow(),
+          col = lg.getColNum(item.getFieldName());
+
       // If the user has edited the cell, or setValue() has been called on the item
       // we don't want a call to redraw() on the item to drop that value
       if (lg.getEditCol() === col) {
         lg.storeUpdatedEditorValue();
       }
-      
+
       if (row === 0 || row > 0) {
-        lg.fireOnPause('refreshEditRow', function() {
+        lg.fireOnPause('refreshEditRow', function () {
           lg.refreshRow(row);
         });
       }
     }
   },
 
-  enableShortcuts: function() {
-    var me = this;
+  enableShortcuts: function () {
+    var me = this,
+        ksAction_FocusFilter, ksAction_FocusGrid, ksAction_ClearFilter, ksAction_SelectAll, ksAction_UnselectAll;
 
-    var ksAction_FocusFilter = function() {
+    ksAction_FocusFilter = function () {
       me.focusInFirstFilterEditor();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('Grid_FocusFilter', 'OBGrid.body', ksAction_FocusFilter);
 
-    var ksAction_FocusGrid = function() {
+    ksAction_FocusGrid = function () {
       me.focus();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('Grid_FocusGrid', 'OBGrid.filter', ksAction_FocusGrid);
 
-    var ksAction_ClearFilter = function() {
+    ksAction_ClearFilter = function () {
       me.clearFilter(true);
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('Grid_ClearFilter', ['OBGrid.body', 'OBGrid.filter'], ksAction_ClearFilter);
 
-    var ksAction_SelectAll = function() {
+    ksAction_SelectAll = function () {
       me.selectAllRecords();
       return false; //To avoid keyboard shortcut propagation
     };
     OB.KeyboardManager.Shortcuts.set('Grid_SelectAll', 'OBGrid.body', ksAction_SelectAll);
 
-    var ksAction_UnselectAll = function() {
+    ksAction_UnselectAll = function () {
       if (me.getSelectedRecords().length > 1) {
         me.deselectAllRecords();
       }
@@ -94,12 +96,12 @@
     OB.KeyboardManager.Shortcuts.set('Grid_UnselectAll', 'OBGrid.body', ksAction_UnselectAll);
   },
 
-  draw : function() {
+  draw: function () {
     this.enableShortcuts();
     this.Super('draw', arguments);
   },
 
-  bodyKeyPress : function (event, eventInfo) {
+  bodyKeyPress: function (event, eventInfo) {
     var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.body');
     if (response !== false) {
       response = this.Super('bodyKeyPress', arguments);
@@ -107,7 +109,7 @@
     return response;
   },
 
-  filterFieldsKeyDown: function(item, form, keyName) {
+  filterFieldsKeyDown: function (item, form, keyName) {
     var response = OB.KeyboardManager.Shortcuts.monitor('OBGrid.filter');
     if (response !== false) {
       response = this.Super('filterFieldsKeyDown', arguments);
@@ -115,10 +117,10 @@
     return response;
   },
 
-  focusInFirstFilterEditor: function() {
+  focusInFirstFilterEditor: function () {
     if (this.getFilterEditor()) { // there is a filter editor
       var object = this.getFilterEditor().getEditForm(),
-        items, item, i, length;
+          items, item, i, length;
 
       // compute a focusable item
       items = object.getItems();
@@ -133,9 +135,10 @@
     }
     return false;
   },
-  
-  createRecordComponent: function(record, colNum){
-    var field = this.getField(colNum), rowNum = this.getRecordIndex(record);
+
+  createRecordComponent: function (record, colNum) {
+    var field = this.getField(colNum),
+        rowNum = this.getRecordIndex(record);
     if (field.isLink && record[field.name]) {
       var linkButton = isc.OBGridLinkLayout.create({
         grid: this,
@@ -149,9 +152,10 @@
     }
     return null;
   },
-  
-  updateRecordComponent: function(record, colNum, component, recordChanged){
-    var field = this.getField(colNum), rowNum = this.getRecordIndex(record);
+
+  updateRecordComponent: function (record, colNum, component, recordChanged) {
+    var field = this.getField(colNum),
+        rowNum = this.getRecordIndex(record);
     if (field.isLink && record[field.name]) {
       component.setTitle(this.formatLinkValue(record, field, colNum, rowNum, record[field.name]));
       component.record = record;
@@ -162,8 +166,8 @@
     }
     return null;
   },
-  
-  formatLinkValue: function(record, field, colNum, rowNum, value){
+
+  formatLinkValue: function (record, field, colNum, rowNum, value) {
     if (typeof value === 'undefined' || value === null) {
       return '';
     }
@@ -176,214 +180,218 @@
     }
     return value;
   },
-  
+
   filterEditorProperties: {
 
-      // http://forums.smartclient.com/showthread.php?p=73107
-      // https://issues.openbravo.com/view.php?id=18557
-      showAllColumns: true,
-      
-      setEditValue : function (rowNum, colNum, newValue, suppressDisplay, suppressChange) {
-        // prevent any setting of non fields in the filter editor
-        // this prevents a specific issue that smartclient will set a value
-        // in the {field.name}._identifier (for example warehouse._identifier)
-        // because it thinks that the field does not have its own datasource
-        if (isc.isA.String(colNum) && !this.getField(colNum)) {
+    // http://forums.smartclient.com/showthread.php?p=73107
+    // https://issues.openbravo.com/view.php?id=18557
+    showAllColumns: true,
+
+    setEditValue: function (rowNum, colNum, newValue, suppressDisplay, suppressChange) {
+      // prevent any setting of non fields in the filter editor
+      // this prevents a specific issue that smartclient will set a value
+      // in the {field.name}._identifier (for example warehouse._identifier)
+      // because it thinks that the field does not have its own datasource
+      if (isc.isA.String(colNum) && !this.getField(colNum)) {
+        return;
+      }
+      return this.Super('setEditValue', arguments);
+    },
+
+    getValuesAsCriteria: function (advanced, textMatchStyle, returnNulls) {
+      return this.Super('getValuesAsCriteria', [true, textMatchStyle, returnNulls]);
+    },
+
+    // is needed to display information in the checkbox field 
+    // header in the filter editor row
+    isCheckboxField: function () {
+      return false;
+    },
+
+    filterImg: {
+      src: OB.Styles.skinsPath + 'Default/org.openbravo.client.application/images/grid/funnel-icon.png'
+    },
+
+    makeActionButton: function () {
+      var ret = this.Super('makeActionButton', arguments);
+      this.filterImage.setLeft(this.computeFunnelLeft(2));
+      var layout = isc.HLayout.create({
+        styleName: 'OBGridFilterFunnelBackground',
+        width: '100%',
+        height: '100%',
+        left: this.computeFunnelLeft()
+      });
+      this.funnelLayout = layout;
+      this.addChild(layout);
+      return ret;
+    },
+
+    computeFunnelLeft: function (correction) {
+      correction = correction || 0;
+      return this.getInnerWidth() - this.getScrollbarSize() - 3 + correction;
+    },
+
+    // keep the funnel stuff placed correctly
+    layoutChildren: function () {
+      var ret = this.Super("layoutChildren", arguments);
+      if (this.funnelLayout) {
+        this.funnelLayout.setLeft(this.computeFunnelLeft());
+      }
+      if (this.filterImage) {
+        this.filterImage.setLeft(this.computeFunnelLeft(2));
+      }
+      return ret;
+    },
+
+    // overridden for:
+    // https://issues.openbravo.com/view.php?id=18509
+    editorChanged: function (item) {
+      var prop, same, opDefs, val = item.getElementValue(),
+          actOnKeypress = item.actOnKeypress === true ? item.actOnKeypress : this.actOnKeypress;
+
+      if (this.sourceWidget.allowFilterExpressions && val && actOnKeypress) {
+
+        // if someone starts typing and and or then do not filter
+        // onkeypress either
+        if (val.contains(' and') || val.contains(' or ')) {
+          this.preventPerformFilterFiring();
           return;
         }
-        return this.Super('setEditValue', arguments);
-      },
-        
-      getValuesAsCriteria : function (advanced, textMatchStyle, returnNulls) {
-        return this.Super('getValuesAsCriteria', [true, textMatchStyle, returnNulls]);
-      },
-      
-      // is needed to display information in the checkbox field 
-      // header in the filter editor row
-      isCheckboxField: function(){
-        return false;
-      },
- 
-      filterImg: {
-        src: OB.Styles.skinsPath + 'Default/org.openbravo.client.application/images/grid/funnel-icon.png'
-      },
-      
-      makeActionButton: function(){
-        var ret = this.Super('makeActionButton', arguments);
-        this.filterImage.setLeft(this.computeFunnelLeft(2));
-        var layout = isc.HLayout.create({
-          styleName: 'OBGridFilterFunnelBackground',
-          width: '100%',
-          height: '100%',
-          left: this.computeFunnelLeft()
-        });
-        this.funnelLayout = layout;
-        this.addChild(layout);
-        return ret;
-      },
-      
-      computeFunnelLeft: function(correction) {
-        correction = correction || 0;
-        return this.getInnerWidth() - this.getScrollbarSize() - 3 + correction;
-      },
-      
-      // keep the funnel stuff placed correctly
-      layoutChildren : function () {
-        var ret = this.Super("layoutChildren", arguments);
-        if (this.funnelLayout) { 
-            this.funnelLayout.setLeft(this.computeFunnelLeft());
+
+        if (val.startsWith('=')) {
+          this.preventPerformFilterFiring();
+          return;
         }
-        if (this.filterImage) { 
-          this.filterImage.setLeft(this.computeFunnelLeft(2));
-        }
-        return ret;
-      },
-      
-      // overridden for:
-      // https://issues.openbravo.com/view.php?id=18509
-      editorChanged: function (item) {
-        var prop, same, opDefs, val = item.getElementValue(), 
-          actOnKeypress = item.actOnKeypress === true ? item.actOnKeypress : this.actOnKeypress;
-        
-        if (this.sourceWidget.allowFilterExpressions && val && actOnKeypress) {
-          
-          // if someone starts typing and and or then do not filter
-          // onkeypress either
-          if (val.contains(' and') || val.contains(' or ')) {
-            this.preventPerformFilterFiring();
-            return;
-          }
 
-          if (val.startsWith('=')) {
-            this.preventPerformFilterFiring();
-            return;
-          }
+        // now check if the item element value is only
+        // an operator, if so, go away
+        opDefs = isc.DataSource.getSearchOperators();
+        for (prop in opDefs) {
+          if (opDefs.hasOwnProperty(prop)) {
 
-          // now check if the item element value is only
-          // an operator, if so, go away
-          opDefs = isc.DataSource.getSearchOperators();
-          for (prop in opDefs) {
-            if (opDefs.hasOwnProperty(prop)) {
+            // let null and not null fall through
+            // as they should be filtered
+            if (prop === 'isNull' || prop === 'notNull') {
+              continue;
+            }
 
-              // let null and not null fall through
-              // as they should be filtered
-              if (prop === 'isNull' || prop === 'notNull') {
-                continue;
-              }
-              
-              same = opDefs[prop].symbol && val.startsWith(opDefs[prop].symbol);
-              if (same) {
-                this.preventPerformFilterFiring();
-                return;
-              }
+            same = opDefs[prop].symbol && val.startsWith(opDefs[prop].symbol);
+            if (same) {
+              this.preventPerformFilterFiring();
+              return;
             }
           }
         }
-        return this.Super('editorChanged', arguments);
-      },
-      
-      // function called to clear any pending performFilter calls
-      // earlier type actions can already have pending filter actions
-      // this deletes them
-      preventPerformFilterFiring: function() {
-        this.fireOnPause("performFilter", {}, this.fetchDelay);
-      },
-      
-      // repair that filter criteria on fk fields can be 
-      // on the identifier instead of the field itself.
-      // after applying the filter the grid will set the criteria
-      // back in the filtereditor effectively clearing
-      // the filter field. The code here repairs/prevents this.
-      setValuesAsCriteria: function (criteria, refresh) {
-        // create an edit form right away
-        if (!this.getEditForm()) {
-          this.makeEditForm();
-        }
-        var prop, fullPropName;
-        // make a copy so that we don't change the object
-        // which is maybe used somewhere else
-        criteria = isc.clone(criteria);
-        var internCriteria = criteria.criteria;
-        if (internCriteria && this.getEditForm()) {
-          // now remove anything which is not a field
-          // otherwise smartclient will keep track of them and send them again
-          var fields = this.getEditForm().getFields(), length = fields.length, i;
-          for (i = internCriteria.length - 1; i >=0; i--) {
-            prop = internCriteria[i].fieldName;
-            // happens when the internCriteria[i], is again an advanced criteria
-            if (!prop) {
-              continue;
+      }
+      return this.Super('editorChanged', arguments);
+    },
+
+    // function called to clear any pending performFilter calls
+    // earlier type actions can already have pending filter actions
+    // this deletes them
+    preventPerformFilterFiring: function () {
+      this.fireOnPause("performFilter", {}, this.fetchDelay);
+    },
+
+    // repair that filter criteria on fk fields can be 
+    // on the identifier instead of the field itself.
+    // after applying the filter the grid will set the criteria
+    // back in the filtereditor effectively clearing
+    // the filter field. The code here repairs/prevents this.
+    setValuesAsCriteria: function (criteria, refresh) {
+      // create an edit form right away
+      if (!this.getEditForm()) {
+        this.makeEditForm();
+      }
+      var prop, fullPropName;
+      // make a copy so that we don't change the object
+      // which is maybe used somewhere else
+      criteria = isc.clone(criteria);
+      var internCriteria = criteria.criteria;
+      if (internCriteria && this.getEditForm()) {
+        // now remove anything which is not a field
+        // otherwise smartclient will keep track of them and send them again
+        var fields = this.getEditForm().getFields(),
+            length = fields.length,
+            i;
+        for (i = internCriteria.length - 1; i >= 0; i--) {
+          prop = internCriteria[i].fieldName;
+          // happens when the internCriteria[i], is again an advanced criteria
+          if (!prop) {
+            continue;
+          }
+          fullPropName = prop;
+          if (prop.endsWith('.' + OB.Constants.IDENTIFIER)) {
+            var index = prop.lastIndexOf('.');
+            prop = prop.substring(0, index);
+          }
+          var fnd = false,
+              j;
+          for (j = 0; j < length; j++) {
+            if (fields[j].displayField === fullPropName) {
+              fnd = true;
+              break;
             }
-            fullPropName = prop;
-            if (prop.endsWith('.' + OB.Constants.IDENTIFIER)) {
-              var index = prop.lastIndexOf('.');
-              prop = prop.substring(0, index);
+            if (fields[j].name === prop) {
+              internCriteria[i].fieldName = prop;
+              fnd = true;
+              break;
             }
-            var fnd = false, j;
-            for (j = 0; j < length; j++) {
-              if (fields[j].displayField === fullPropName) {
-                fnd = true;
-                break;
-              }
-              if (fields[j].name === prop) {
-                internCriteria[i].fieldName = prop;
-                fnd = true;
-                break;
-              }
-              if (fields[j].name === fullPropName) {
-                fnd = true;
-                break;
-              }
-            }
-            if (!fnd) {
-              internCriteria.removeAt(i);
+            if (fields[j].name === fullPropName) {
+              fnd = true;
+              break;
             }
           }
-        }
-
-        return this.Super('setValuesAsCriteria', [criteria, refresh]);
-      },
-      
-      // the filtereditor will assign the grids datasource to a field
-      // if it has a display field and no datasource
-      // prevent this as we get the datasource later it is not 
-      // yet set
-      getEditorProperties : function (field) {
-        var noDataSource = field.displayField && !field.optionDataSource,
-          ret = this.Super('getEditorProperties', arguments);
-        if (ret.optionDataSource && noDataSource) {
-          delete ret.optionDataSource;
-        }
-        return ret;
-      },
-      
-      actionButtonProperties: {
-        baseStyle: 'OBGridFilterFunnelIcon',
-        visibility: 'hidden',
-        showFocused: false,
-        showDisabled: false,
-        prompt: OB.I18N.getLabel('OBUIAPP_GridFilterIconToolTip'),
-        initWidget: function(){
-          this.recordEditor.sourceWidget.filterImage = this;
-          this.recordEditor.filterImage = this;
-          if (this.recordEditor.sourceWidget.filterClause) {
-            this.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterImplicitToolTip');      
-            this.visibility = 'inherit';
+          if (!fnd) {
+            internCriteria.removeAt(i);
           }
-          this.Super('initWidget', arguments);
-        },
-        click: function(){
-          this.recordEditor.sourceWidget.clearFilter();
         }
       }
+
+      return this.Super('setValuesAsCriteria', [criteria, refresh]);
     },
 
-  initWidget: function(){
+    // the filtereditor will assign the grids datasource to a field
+    // if it has a display field and no datasource
+    // prevent this as we get the datasource later it is not 
+    // yet set
+    getEditorProperties: function (field) {
+      var noDataSource = field.displayField && !field.optionDataSource,
+          ret = this.Super('getEditorProperties', arguments);
+      if (ret.optionDataSource && noDataSource) {
+        delete ret.optionDataSource;
+      }
+      return ret;
+    },
+
+    actionButtonProperties: {
+      baseStyle: 'OBGridFilterFunnelIcon',
+      visibility: 'hidden',
+      showFocused: false,
+      showDisabled: false,
+      prompt: OB.I18N.getLabel('OBUIAPP_GridFilterIconToolTip'),
+      initWidget: function () {
+        this.recordEditor.sourceWidget.filterImage = this;
+        this.recordEditor.filterImage = this;
+        if (this.recordEditor.sourceWidget.filterClause) {
+          this.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterImplicitToolTip');
+          this.visibility = 'inherit';
+        }
+        this.Super('initWidget', arguments);
+      },
+      click: function () {
+        this.recordEditor.sourceWidget.clearFilter();
+      }
+    }
+  },
+
+  initWidget: function () {
     // prevent the value to be displayed in case of a link
-    var i, length, field,
-      formatCellValueFunction = function(value, record, rowNum, colNum, grid){
-        return '';
-      };
+    var i, length, field, formatCellValueFunction;
+
+    formatCellValueFunction = function (value, record, rowNum, colNum, grid) {
+      return '';
+    };
 
     if (this.fields) {
       length = this.fields.length;
@@ -406,21 +414,22 @@
         }
       }
     }
-    
+
     this.Super('initWidget', arguments);
   },
 
-  clearFilter: function(keepFilterClause, noPerformAction){
-    var i = 0, fld, length;
+  clearFilter: function (keepFilterClause, noPerformAction) {
+    var i = 0,
+        fld, length;
     if (!keepFilterClause) {
       delete this.filterClause;
     }
     this.forceRefresh = true;
     this.filterEditor.getEditForm().clearValues();
-    
+
     // clear the date values in a different way
     length = this.filterEditor.getEditForm().getFields().length;
-    
+
     for (i = 0; i < length; i++) {
       fld = this.filterEditor.getEditForm().getFields()[i];
       if (fld.clearDateValues) {
@@ -431,8 +440,8 @@
       this.filterEditor.performAction();
     }
   },
-  
-  showSummaryRow: function(){
+
+  showSummaryRow: function () {
     var i, fld, fldsLength, newFields = [];
     var ret = this.Super('showSummaryRow', arguments);
     if (this.summaryRow && !this.summaryRowFieldRepaired) {
@@ -459,28 +468,27 @@
     }
     return ret;
   },
-  
+
   // show or hide the filter button
-  filterEditorSubmit: function(criteria){
+  filterEditorSubmit: function (criteria) {
     this.checkShowFilterFunnelIcon(criteria);
   },
-  
+
   checkShowFilterFunnelIcon: function (criteria) {
     if (!this.filterImage) {
       return;
     }
     var gridIsFiltered = this.isGridFiltered(criteria);
-    var noParentOrParentSelected = !this.view || !this.view.parentView ||
-        (this.view.parentView.viewGrid.getSelectedRecords() && this.view.parentView.viewGrid.getSelectedRecords().length > 0);
-    
+    var noParentOrParentSelected = !this.view || !this.view.parentView || (this.view.parentView.viewGrid.getSelectedRecords() && this.view.parentView.viewGrid.getSelectedRecords().length > 0);
+
     if (this.filterClause && gridIsFiltered) {
-      this.filterImage.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterBothToolTip');      
+      this.filterImage.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterBothToolTip');
       this.filterImage.show(true);
     } else if (this.filterClause) {
-      this.filterImage.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterImplicitToolTip');      
+      this.filterImage.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterImplicitToolTip');
       this.filterImage.show(true);
     } else if (gridIsFiltered) {
-      this.filterImage.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterExplicitToolTip');      
+      this.filterImage.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterExplicitToolTip');
       this.filterImage.show(true);
     } else {
       this.filterImage.prompt = OB.I18N.getLabel('OBUIAPP_GridFilterIconToolTip');
@@ -489,22 +497,18 @@
       }
       this.filterImage.hide();
     }
-    
+
     if (this.filterClause && !this.view.isShowingForm && !this.view.messageBar.isVisible()) {
       var showMessageProperty = OB.PropertyStore.get('OBUIAPP_ShowImplicitFilterMsg'),
           showMessage = (showMessageProperty !== 'N' && showMessageProperty !== '"N"' && noParentOrParentSelected);
       if (showMessage) {
-        this.view.messageBar.setMessage(isc.OBMessageBar.TYPE_INFO, '<div><div style="float: left;">'+
-            this.filterName + '<br/>' + OB.I18N.getLabel('OBUIAPP_ClearFilters') + 
-            '</div><div style="float: right; padding-top: 15px;"><a href="#" style="font-weight:normal; color:inherit;" onclick="' +
-            'window[\'' + this.view.messageBar.ID + '\'].hide(); OB.PropertyStore.set(\'OBUIAPP_ShowImplicitFilterMsg\', \'N\');">'+
-            OB.I18N.getLabel('OBUIAPP_NeverShowMessageAgain')+'</a></div></div>',' ');
+        this.view.messageBar.setMessage(isc.OBMessageBar.TYPE_INFO, '<div><div style="float: left;">' + this.filterName + '<br/>' + OB.I18N.getLabel('OBUIAPP_ClearFilters') + '</div><div style="float: right; padding-top: 15px;"><a href="#" style="font-weight:normal; color:inherit;" onclick="' + 'window[\'' + this.view.messageBar.ID + '\'].hide(); OB.PropertyStore.set(\'OBUIAPP_ShowImplicitFilterMsg\', \'N\');">' + OB.I18N.getLabel('OBUIAPP_NeverShowMessageAgain') + '</a></div></div>', ' ');
         this.view.messageBar.hasFilterMessage = true;
-      } 
+      }
     }
   },
-  
-  isGridFiltered: function(criteria) {
+
+  isGridFiltered: function (criteria) {
     if (!this.filterEditor) {
       return false;
     }
@@ -516,8 +520,8 @@
     }
     return this.isGridFilteredWithCriteria(criteria.criteria);
   },
-  
-  isGridFilteredWithCriteria: function(criteria) {
+
+  isGridFilteredWithCriteria: function (criteria) {
     var i, length;
     if (!criteria) {
       return false;
@@ -555,7 +559,7 @@
     return false;
   },
 
-  isValidFilterField: function(field){
+  isValidFilterField: function (field) {
     if (!field) {
       return false;
     }
@@ -569,42 +573,45 @@
   // * {{{exportProperties}}} defines different properties used for controlling the export, currently only the 
   // exportProperties.exportFormat is supported (which is defaulted to csv).
   // * {{{data}}} the parameters to post to the server, in addition the filter criteria of the grid are posted.  
-  exportData: function(exportProperties, data){
-    var d = data || {}, expProp = exportProperties || {}, dsURL = this.dataSource.dataURL;
+  exportData: function (exportProperties, data) {
+    var d = data || {},
+        expProp = exportProperties || {},
+        dsURL = this.dataSource.dataURL;
     var sortCriteria;
     var lcriteria = this.getCriteria();
     var gdata = this.getData();
-    if(gdata && gdata.dataSource){
+    if (gdata && gdata.dataSource) {
       lcriteria = gdata.dataSource.convertRelativeDates(lcriteria);
     }
-    
+
     isc.addProperties(d, {
       _dataSource: this.dataSource.ID,
       _operationType: 'fetch',
-      _noCount: true, // never do count for export
+      _noCount: true,
+      // never do count for export
       exportAs: expProp.exportAs || 'csv',
       viewState: expProp.viewState,
       tab: expProp.tab,
       exportToFile: true,
       _textMatchStyle: 'substring'
     }, lcriteria, this.getFetchRequestParams());
-    if(this.getSortField()){
-      sortCriteria=this.getSort();
-      if(sortCriteria && sortCriteria.length > 0){
+    if (this.getSortField()) {
+      sortCriteria = this.getSort();
+      if (sortCriteria && sortCriteria.length > 0) {
         d._sortBy = sortCriteria[0].property;
-        if(sortCriteria[0].direction === 'descending'){
+        if (sortCriteria[0].direction === 'descending') {
           d._sortBy = '-' + d._sortBy;
         }
       }
     }
     OB.Utilities.postThroughHiddenForm(dsURL, d);
   },
-  
-  getFetchRequestParams: function(params) {
+
+  getFetchRequestParams: function (params) {
     return params;
   },
-  
-  editorKeyDown : function (item, keyName) {
+
+  editorKeyDown: function (item, keyName) {
     if (item) {
       if (typeof item.keyDownAction === 'function') {
         item.keyDownAction();
@@ -612,10 +619,10 @@
     }
     return this.Super('editorKeyDown', arguments);
   },
-  
+
   // Prevents empty message to be shown in frozen part
   // http://forums.smartclient.com/showthread.php?p=57581
-  createBodies: function(){
+  createBodies: function () {
     var ret = this.Super('createBodies', arguments);
     if (this.frozenBody) {
       this.frozenBody.showEmptyMessage = false;
@@ -625,8 +632,9 @@
 
   //= getErrorRows =
   // Returns all the rows that have errors.
-  getErrorRows: function(){
-    var editRows, errorRows = [], i, length;
+  getErrorRows: function () {
+    var editRows, errorRows = [],
+        i, length;
 
     if (this.hasErrors()) {
       editRows = this.getAllEditRows(true);
@@ -644,7 +652,7 @@
 isc.ClassFactory.defineClass('OBGridSummary', isc.OBGrid);
 
 isc.OBGridSummary.addProperties({
-  getCellStyle: function(record, rowNum, colNum){
+  getCellStyle: function (record, rowNum, colNum) {
     var field = this.getField(colNum);
     if (field.summaryFunction === 'sum' && this.summaryRowStyle_sum) {
       return this.summaryRowStyle_sum;
@@ -664,36 +672,36 @@
   btn: null,
   height: 1,
   width: '100%',
-  
-  initWidget: function(){
+
+  initWidget: function () {
     this.btn = isc.OBGridLinkButton.create({});
     this.btn.setTitle(this.title);
     this.btn.owner = this;
     this.addMember(this.btn);
     this.Super('initWidget', arguments);
   },
-  
-  setTitle: function(title){
+
+  setTitle: function (title) {
     this.btn.setTitle(title);
   },
-  
-  doAction: function(){
+
+  doAction: function () {
     if (this.grid && this.grid.doCellClick) {
       this.grid.doCellClick(this.record, this.rowNum, this.colNum);
     } else if (this.grid && this.grid.cellClick) {
       this.grid.cellClick(this.record, this.rowNum, this.colNum);
     }
   }
-  
+
 });
 
 isc.ClassFactory.defineClass('OBGridLinkButton', isc.Button);
 
 isc.OBGridLinkButton.addProperties({
-  action: function(){
+  action: function () {
     this.owner.doAction();
   }
 });
 
 isc.ClassFactory.defineClass('OBGridFormButton', isc.OBFormButton);
-isc.OBGridFormButton.addProperties({});
+isc.OBGridFormButton.addProperties({});
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Sat Feb 11 15:28:57 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Sat Feb 11 15:48:44 2012 +0100
@@ -20,7 +20,8 @@
 
 isc.OBViewGrid.addClassProperties({
   EDIT_LINK_FIELD_NAME: '_editLink',
-  NO_COUNT_PARAMETER: '_noCount', // prevent the count operation on the server
+  //prevent the count operation on the server
+  NO_COUNT_PARAMETER: '_noCount',
   // note following 2 values should be the same
   // ListGrid._$ArrowUp and ListGrid._$ArrowDown
   ARROW_UP_KEY_NAME: 'Arrow_Up',
@@ -38,12 +39,12 @@
   // handles this form
   // and the grid and other related components.
   view: null,
-  
+
   // ** {{{ editGrid }}} **
   // Controls if an edit link column is created in the grid, set to false to
   // prevent this.
   editGrid: true,
-  
+
   // ** {{{ editLinkFieldProperties }}} **
   // The properties of the ListGridField created for the edit links.
   editLinkFieldProperties: {
@@ -63,22 +64,22 @@
     filterEditorType: 'StaticTextItem',
     name: isc.OBViewGrid.EDIT_LINK_FIELD_NAME
   },
-  
+
   editLinkColNum: -1,
-  
+
   // ** {{{ dataPageSize }}} **
   // The data page size used for loading paged data from the server.
   dataPageSize: 100,
-  
+
   fetchDelay: 500,
-  
+
   autoFitFieldWidths: true,
   autoFitWidthApproach: 'title',
   canAutoFitFields: false,
   minFieldWidth: 75,
   width: '100%',
   height: '100%',
-  
+
   showSortArrow: 'field',
   autoFetchTextMatchStyle: 'substring',
   showFilterEditor: true,
@@ -96,13 +97,13 @@
   canOpenRecordEditor: true,
   showDetailFields: true,
   showErrorIcons: false,
-  
+
   allowFilterExpressions: true,
   showFilterExpressionLegendMenuItem: true,
-  
+
   // internal sc grid property, see the ListGrid source code
   preserveEditsOnSetData: false,
-  
+
   // enabling this results in a slower user interaction
   // it is better to allow fast grid interaction and if an error occurs
   // dismiss any new records being edited and go back to the edit row
@@ -111,14 +112,14 @@
   stopOnErrors: false,
   confirmDiscardEdits: false,
   canMultiSort: false,
-  
+
   emptyMessage: OB.I18N.getLabel('OBUISC_ListGrid.loadingDataMessage'),
   discardEditsSaveButtonTitle: OB.I18N.getLabel('UINAVBA_Save'),
   editPendingCSSText: null,
-  
+
   // commented out because of: https://issues.openbravo.com/view.php?id=16515
   // default is much smaller which give smoother scrolling
-//  quickDrawAheadRatio: 1.0,
+  //  quickDrawAheadRatio: 1.0,
   //drawAheadRatio: 2.0,
   // see this discussion:
   // http://forums.smartclient.com/showthread.php?t=16376
@@ -127,27 +128,27 @@
   // of data, Smartclient will try to read until drawAllMaxCells has been
   // reached
   drawAllMaxCells: 0,
-  
+
   // the default is enabled which is a commonly used field
   recordEnabledProperty: '_enabled',
-  
+
   // keeps track if we are in objectSelectionMode or in toggleSelectionMode
   // objectSelectionMode = singleRecordSelection === true
   singleRecordSelection: false,
-  
+
   // editing props
   rowEndEditAction: 'next',
   listEndEditAction: 'next',
-  
+
   enforceVClipping: true,
   fixedRecordHeights: true,
-  
+
   validateByCell: true,
-  
+
   currentEditColumnLayout: null,
-  
+
   recordBaseStyleProperty: '_recordStyle',
-  
+
   // set to false because of this: https://issues.openbravo.com/view.php?id=16509
   modalEditing: false,
   // set to true because if not all cols are drawn then when doing inline editing
@@ -158,9 +159,8 @@
   // http://forums.smartclient.com/showthread.php?p=63146
   showAllColumns: true,
   //showGridSummary: true,
-  
   timeFormatter: 'to24HourTime',
-  
+
   dataProperties: {
     // this means that after an update/add the new/updated row does not fit 
     // in the current filter criteria then they are still shown
@@ -172,17 +172,17 @@
     useClientSorting: false,
 
     // overridden to update the context/request properties for the fetch
-    fetchRemoteData : function (serverCriteria, startRow, endRow) {
+    fetchRemoteData: function (serverCriteria, startRow, endRow) {
       var requestProperties = this.context;
       this.grid.getFetchRequestParams(requestProperties.params);
 
       return this.Super('fetchRemoteData', arguments);
     },
 
-    clearLoadingMarkers: function(start, end) {
+    clearLoadingMarkers: function (start, end) {
       var j;
       if (this.localData) {
-        for (j = start; j < end; j++) { 
+        for (j = start; j < end; j++) {
           if (Array.isLoading(this.localData[j])) {
             this.localData[j] = null;
           }
@@ -190,9 +190,9 @@
       }
     },
 
-    transformData: function(newData, dsResponse) {
+    transformData: function (newData, dsResponse) {
       var i, length;
-      
+
       // only do this stuff for fetch operations, in other cases strange things
       // happen as update/delete operations do not return the totalRows parameter
       if (dsResponse && dsResponse.context && dsResponse.context.operationType !== 'fetch') {
@@ -223,13 +223,14 @@
 
   initWidget: function () {
     var i, vwState;
-    
+
     // make a copy of the dataProperties otherwise we get 
     // change results that values of one grid are copied/coming back
     // in other grids
     this.dataProperties = isc.addProperties({}, this.dataProperties);
 
-    var thisGrid = this, localEditLinkField;
+    var thisGrid = this,
+        localEditLinkField;
     if (this.editGrid) {
       // add the edit pencil in the beginning
       localEditLinkField = isc.addProperties({}, this.editLinkFieldProperties);
@@ -255,34 +256,35 @@
 
     var grid = this;
     var menuItems = [{
-        title: OB.I18N.getLabel('OBUIAPP_CreateRecordInGrid'),
-        click: function(){
-          grid.deselectAllRecords();
-          grid.startEditingNew();
-        }
-      }, {
-        title: OB.I18N.getLabel('OBUIAPP_CreateRecordInForm'),
-        click: function(){
-          grid.deselectAllRecords();
-          grid.view.newDocument();
-        }
+      title: OB.I18N.getLabel('OBUIAPP_CreateRecordInGrid'),
+      click: function () {
+        grid.deselectAllRecords();
+        grid.startEditingNew();
       }
-    ];
+    }, {
+      title: OB.I18N.getLabel('OBUIAPP_CreateRecordInForm'),
+      click: function () {
+        grid.deselectAllRecords();
+        grid.view.newDocument();
+      }
+    }];
 
     if (this.showSortArrow === 'field') {
       // solves https://issues.openbravo.com/view.php?id=17362
       this.showSortArrow = isc.ListGrid.BOTH;
       this.sorterDefaults = {};
     }
-    
-	// TODO: add dynamic part of readonly (via setWindowSettings: see issue 17441)
+
+    // TODO: add dynamic part of readonly (via setWindowSettings: see issue 17441)
     // add context-menu only if 'new' is allowed in tab definition
     if (this.uiPattern !== 'SR' && this.uiPattern !== 'RO') {
-      this.contextMenu = this.getMenuConstructor().create({items: menuItems});
+      this.contextMenu = this.getMenuConstructor().create({
+        items: menuItems
+      });
     }
-  
+
     var ret = this.Super('initWidget', arguments);
-    
+
     // only personalize if there is a professional license
     if (!OB.Utilities.checkProfessionalLicense(null, true)) {
       vwState = this.view.standardWindow.getDefaultGridViewState(this.view.tabId);
@@ -290,14 +292,9 @@
         this.setViewState(vwState);
       }
     }
-    
+
     this.noDataEmptyMessage = '<span class="OBGridNotificationText">' + OB.I18N.getLabel('OBUISC_ListGrid.loadingDataMessage') + '</span>'; // OB.I18N.getLabel('OBUIAPP_GridNoRecords')
-    this.filterNoRecordsEmptyMessage = '<span class="OBGridNotificationText">' + OB.I18N.getLabel('OBUIAPP_GridFilterNoResults') + '</span>' +
-    '<span onclick="window[\'' +
-    this.ID +
-    '\'].clearFilter();" class="OBLinkButtonItem">' +
-    OB.I18N.getLabel('OBUIAPP_GridClearFilter') +
-    '</span>';
+    this.filterNoRecordsEmptyMessage = '<span class="OBGridNotificationText">' + OB.I18N.getLabel('OBUIAPP_GridFilterNoResults') + '</span>' + '<span onclick="window[\'' + this.ID + '\'].clearFilter();" class="OBLinkButtonItem">' + OB.I18N.getLabel('OBUIAPP_GridClearFilter') + '</span>';
 
     return ret;
   },
@@ -306,14 +303,15 @@
   // see why this needs to be done in the 
   // documentation of canvas.contextMenu in Canvas.js
   destroy: function () {
-    var i, field, fields = this.getFields(), 
-      editorProperties, len = fields.length, ds, dataSources = [];
+    var i, field, fields = this.getFields(),
+        editorProperties, len = fields.length,
+        ds, dataSources = [];
 
-    for(i = 0; i < len; i++) {
+    for (i = 0; i < len; i++) {
       field = fields[i];
       editorProperties = field && field.editorProperties;
       ds = editorProperties && editorProperties.optionDataSource;
-      if(ds) {
+      if (ds) {
         dataSources.push(ds);
       }
     }
@@ -327,35 +325,35 @@
 
     len = dataSources.length;
 
-    for(i = 0; i < len; i++) {
+    for (i = 0; i < len; i++) {
       ds = dataSources[i];
-      if(ds) {
+      if (ds) {
         ds.destroy();
         ds = null;
       }
     }
   },
-  
-  setData: function(data) {
+
+  setData: function (data) {
     data.grid = this;
     this.Super('setData', arguments);
   },
 
-  refreshFields: function(){
+  refreshFields: function () {
     this.setFields(this.completeFields.duplicate());
   },
 
-  draw: function() {
-    var drawnBefore = this.isDrawn(), i, form, item, items, length;
+  draw: function () {
+    var drawnBefore = this.isDrawn(),
+        i, form, item, items, length;
 
     this.Super('draw', arguments);
-    
+
     // set the focus in the filter editor
-    if (this.view && this.view.isActiveView() && !drawnBefore && this.isVisible() &&
-        this.getFilterEditor() && this.getFilterEditor().getEditForm()) {
+    if (this.view && this.view.isActiveView() && !drawnBefore && this.isVisible() && this.getFilterEditor() && this.getFilterEditor().getEditForm()) {
       // there is a filter editor
       form = this.getFilterEditor().getEditForm();
-      
+
       // compute a focus item, set focus with some delay
       // to give everyone time to be ready
       if (!form.getFocusItem()) {
@@ -374,25 +372,25 @@
       }
     }
   },
-  
+
   // add the properties from the form
-  addFormProperties: function(props){
+  addFormProperties: function (props) {
     isc.addProperties(this.editFormDefaults, props);
   },
-  
-  getCellVAlign: function() {
+
+  getCellVAlign: function () {
     return 'center';
   },
-  
-  getCellAlign: function(record, rowNum, colNum){
+
+  getCellAlign: function (record, rowNum, colNum) {
     if (rowNum === this.getEditRow()) {
       return 'center';
     }
     return this.Super('getCellAlign', arguments);
   },
-  
+
   // overridden to support hover on the header for the checkbox field
-  setFieldProperties: function(field, properties){
+  setFieldProperties: function (field, properties) {
     var localField = field;
     if (isc.isA.Number(localField)) {
       localField = this.fields[localField];
@@ -401,12 +399,14 @@
       properties.showHover = true;
       properties.prompt = OB.I18N.getLabel('OBUIAPP_GridSelectAllColumnPrompt');
     }
-    
+
     return this.Super('setFieldProperties', arguments);
   },
-  
-  cellHoverHTML: function(record, rowNum, colNum){
-    var ret, field = this.getField(colNum), cellErrors, msg = '', i;
+
+  cellHoverHTML: function (record, rowNum, colNum) {
+    var ret, field = this.getField(colNum),
+        cellErrors, msg = '',
+        i;
     if (this.isCheckboxField(field)) {
       return OB.I18N.getLabel('OBUIAPP_GridSelectColumnPrompt');
     }
@@ -421,37 +421,37 @@
     if (record && record[isc.OBViewGrid.ERROR_MESSAGE_PROP]) {
       return record[isc.OBViewGrid.ERROR_MESSAGE_PROP];
     }
-    
+
     this.inCellHoverHTML = true;
     ret = this.Super('cellHoverHTML', arguments);
     delete this.inCellHoverHTML;
     return ret;
   },
-  
-  reorderField: function(fieldNum, moveToPosition){
+
+  reorderField: function (fieldNum, moveToPosition) {
     var res = this.Super('reorderField', arguments);
     this.view.standardWindow.storeViewState();
     return res;
   },
 
-  hideField: function(field, suppressRelayout){
+  hideField: function (field, suppressRelayout) {
     var res = this.Super('hideField', arguments);
     this.view.standardWindow.storeViewState();
     return res;
   },
 
-  showField: function(field, suppressRelayout){
+  showField: function (field, suppressRelayout) {
     var res = this.Super('showField', arguments);
     this.view.standardWindow.storeViewState();
     return res;
   },
 
-  resizeField: function(fieldNum, newWidth, storeWidth){
+  resizeField: function (fieldNum, newWidth, storeWidth) {
     var res = this.Super('resizeField', arguments);
     this.view.standardWindow.storeViewState();
     return res;
   },
-  
+
   // also store the filter criteria
   getViewState: function (returnObject, includeFilter) {
     var state = this.Super('getViewState', [returnObject || true]);
@@ -463,39 +463,39 @@
         state.noFilterClause = true;
       }
     }
-    
+
     // get rid of the selected state
     delete state.selected;
-   
+
     this.deleteSelectedParentRecordFilter(state);
-    
+
     if (returnObject) {
       return state;
     }
-    return '(' + isc.Comm.serialize(state,false) + ')';
+    return '(' + isc.Comm.serialize(state, false) + ')';
   },
-  
+
   setViewState: function (state) {
-	var localState;
+    var localState;
     localState = this.evalViewState(state, 'viewState');
-    
+
     // strange case, sometimes need to call twice
     if (isc.isA.String(localState)) {
       localState = this.evalViewState(state, 'viewState');
     }
-    
+
     if (!localState) {
       return;
     }
-    
+
     if (this.getDataSource()) {
       // old versions stored selected records in grid view, this can cause
       // problems if record is not selected yet
       delete localState.selected;
 
-      this.deleteSelectedParentRecordFilter(localState);    
-      
-      this.Super('setViewState', ['(' + isc.Comm.serialize(localState,false) + ')']);
+      this.deleteSelectedParentRecordFilter(localState);
+
+      this.Super('setViewState', ['(' + isc.Comm.serialize(localState, false) + ')']);
     }
 
     if (localState.noFilterClause) {
@@ -506,55 +506,52 @@
     }
 
     // and no additional filter clauses passed in
-    if (localState.filter && 
-        this.view.tabId !== this.view.standardWindow.additionalCriteriaTabId &&
-        this.view.tabId !== this.view.standardWindow.additionalFilterTabId) {
+    if (localState.filter && this.view.tabId !== this.view.standardWindow.additionalCriteriaTabId && this.view.tabId !== this.view.standardWindow.additionalFilterTabId) {
       this.setCriteria(localState.filter);
     }
   },
-  
+
   //Deletes the implicit filter on the selected record of the parent
-  deleteSelectedParentRecordFilter: function(state) {
-	var i, filterLength, filterItem;
-	if (state.filter) {
-	  filterLength = state.filter.criteria.length;
-	  for (i = 0; i < filterLength; i++) {
-	    filterItem = state.filter.criteria[i];
-	    if (filterItem.fieldName === this.view.parentProperty) {
-	      //This way it is ensured that the sub tabs will not show the registers associated with
-	      // the register of its parent tab that was selected when the filter was created
-	      state.filter.criteria[i].value = '-1';
-	      break;
-	    }
-	  } 
-	}
+  deleteSelectedParentRecordFilter: function (state) {
+    var i, filterLength, filterItem;
+    if (state.filter) {
+      filterLength = state.filter.criteria.length;
+      for (i = 0; i < filterLength; i++) {
+        filterItem = state.filter.criteria[i];
+        if (filterItem.fieldName === this.view.parentProperty) {
+          //This way it is ensured that the sub tabs will not show the registers associated with
+          // the register of its parent tab that was selected when the filter was created
+          state.filter.criteria[i].value = '-1';
+          break;
+        }
+      }
+    }
   },
- 
-  setView: function(view){
+
+  setView: function (view) {
     var dataPageSizeaux, length, i, crit;
-    
+
     this.view = view;
-    
+
     this.editFormDefaults.view = view;
-    
+
     if (this.getField(this.view.parentProperty)) {
       this.getField(this.view.parentProperty).canFilter = false;
       this.getField(this.view.parentProperty).canEdit = false;
     }
- 
-  //// Begins-added to have the additional filter clause and tabid..Mallikarjun M
- //URL example:http://localhost:8080/openbravo/?tabId=186&filterClause=e.businessPartner.searchKey%3D%27mcgiver%27&replaceDefaultFilter=true&
+
+    //// Begins-added to have the additional filter clause and tabid..Mallikarjun M
+    //URL example:http://localhost:8080/openbravo/?tabId=186&filterClause=e.businessPartner.searchKey%3D%27mcgiver%27&replaceDefaultFilter=true&
     if (this.view.tabId === this.view.standardWindow.additionalFilterTabId) {
-        
-      if (!this.filterClause || this.view.standardWindow.replaceDefaultFilter==='true') {
+
+      if (!this.filterClause || this.view.standardWindow.replaceDefaultFilter === 'true') {
         this.filterClause = unescape(this.view.standardWindow.additionalFilterClause);
       } else if (this.filterClause) {
-        this.filterClause = '((' + this.filterClause + ') and (' +unescape(this.view.standardWindow.additionalFilterClause)  + '))';
+        this.filterClause = '((' + this.filterClause + ') and (' + unescape(this.view.standardWindow.additionalFilterClause) + '))';
       }
     }
- //// Ends..
-    if (this.view.tabId === this.view.standardWindow.additionalCriteriaTabId && 
-        this.view.standardWindow.additionalCriteria) {
+    //// Ends..
+    if (this.view.tabId === this.view.standardWindow.additionalCriteriaTabId && this.view.standardWindow.additionalCriteria) {
       crit = isc.JSON.decode(unescape(this.view.standardWindow.additionalCriteria));
       this.setCriteria(crit);
       delete this.view.standardWindow.additionalCriteria;
@@ -562,7 +559,7 @@
     // if there is no autoexpand field then just divide the space
     if (!this.getAutoFitExpandField()) {
       length = this.fields.length;
-      
+
       // nobody, then give all the fields a new size, dividing
       // the space among them
       for (i = 0; i < length; i++) {
@@ -574,23 +571,23 @@
       }
     }
     //Modify the quantity of lines to count per Window
-    dataPageSizeaux = OB.PropertyStore.get('dataPageSize',this.view.windowId);
+    dataPageSizeaux = OB.PropertyStore.get('dataPageSize', this.view.windowId);
     this.dataPageSize = dataPageSizeaux ? +dataPageSizeaux : 100;
   },
 
-  show: function(){
+  show: function () {
     var ret = this.Super('show', arguments);
-    
+
     this.view.toolBar.updateButtonState(true);
-    
+
     this.updateRowCountDisplay();
-    
+
     this.resetEmptyMessage();
-    
+
     return ret;
   },
-  
-  headerClick: function(fieldNum, header, autoSaveDone){
+
+  headerClick: function (fieldNum, header, autoSaveDone) {
     delete this.wasEditing;
     if (!autoSaveDone) {
       var actionObject = {
@@ -608,23 +605,19 @@
     }
     return this.Super('headerClick', arguments);
   },
-/*
 
-  */
-
-  keyPress: function() {
+  keyPress: function () {
     var response = OB.KeyboardManager.Shortcuts.monitor('OBViewGrid');
     if (response !== false) {
       response = this.Super('keyPress', arguments);
     }
     return response;
   },
-  
+
   bodyKeyPress: function (event, eventInfo) {
     var response = OB.KeyboardManager.Shortcuts.monitor('OBViewGrid.body');
     if (response !== false) {
-      if (event.keyName === 'Space' && 
-        (isc.EventHandler.ctrlKeyDown() || isc.EventHandler.altKeyDown() || isc.EventHandler.shiftKeyDown())) {
+      if (event.keyName === 'Space' && (isc.EventHandler.ctrlKeyDown() || isc.EventHandler.altKeyDown() || isc.EventHandler.shiftKeyDown())) {
         return true;
       }
       response = this.Super('bodyKeyPress', arguments);
@@ -633,7 +626,7 @@
   },
 
   // called when the view gets activated
-  setActive: function(active) {
+  setActive: function (active) {
     if (active) {
       this.enableShortcuts();
     } else {
@@ -641,15 +634,20 @@
     }
   },
 
-  disableShortcuts: function() {
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_EditInGrid', null, function() { return true; });
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_EditInForm', null, function() { return true; });
+  disableShortcuts: function () {
+    OB.KeyboardManager.Shortcuts.set('ViewGrid_EditInGrid', null, function () {
+      return true;
+    });
+    OB.KeyboardManager.Shortcuts.set('ViewGrid_EditInForm', null, function () {
+      return true;
+    });
   },
-  
-  enableShortcuts: function() {
-    var me = this;
 
-    var ksAction_CancelEditing = function() {
+  enableShortcuts: function () {
+    var me = this,
+        ksAction_CancelEditing, ksAction_MoveUpWhileEditing, ksAction_MoveDownWhileEditing, ksAction_DeleteSelectedRecords, ksAction_EditInGrid, ksAction_EditInForm, ksAction_CancelChanges;
+
+    ksAction_CancelEditing = function () {
       if (me.getEditForm()) {
         me.cancelEditing();
         return false; //To avoid keyboard shortcut propagation
@@ -659,7 +657,7 @@
     };
     OB.KeyboardManager.Shortcuts.set('ViewGrid_CancelEditing', ['OBViewGrid', 'OBViewGrid.body'], ksAction_CancelEditing);
 
-    var ksAction_MoveUpWhileEditing = function() {
+    ksAction_MoveUpWhileEditing = function () {
       if (me.getEditForm()) {
         var editRow = me.getEditRow();
         me.cancelEditing();
@@ -671,9 +669,11 @@
         return true;
       }
     };
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_MoveUpWhileEditing', ['OBViewGrid', 'OBViewGrid.body'], ksAction_MoveUpWhileEditing, null, {"key": "Arrow_Up"});
+    OB.KeyboardManager.Shortcuts.set('ViewGrid_MoveUpWhileEditing', ['OBViewGrid', 'OBViewGrid.body'], ksAction_MoveUpWhileEditing, null, {
+      "key": "Arrow_Up"
+    });
 
-    var ksAction_MoveDownWhileEditing = function() {
+    ksAction_MoveDownWhileEditing = function () {
       if (me.getEditForm()) {
         var editRow = me.getEditRow();
         me.cancelEditing();
@@ -685,9 +685,11 @@
         return true;
       }
     };
-    OB.KeyboardManager.Shortcuts.set('ViewGrid_MoveDownWhileEditing', ['OBViewGrid', 'OBViewGrid.body'], ksAction_MoveDownWhileEditing, null, {"key": "Arrow_Down"});
+    OB.KeyboardManager.Shortcuts.set('ViewGrid_MoveDownWhileEditing', ['OBViewGrid', 'OBViewGrid.body'], ksAction_MoveDownWhileEditing, null, {
+      "key": "Arrow_Down"
+    });
 
-    var ksAction_DeleteSelectedRecords = function() {
+    ksAction_DeleteSelectedRecords = function () {
       if (me.getSelectedRecords().length > 0) {
         me.view.deleteSelectedRows();
         return false; //To avoid keyboard shortcut propagation
@@ -697,7 +699,7 @@
     };
     OB.KeyboardManager.Shortcuts.set('ViewGrid_DeleteSelectedRecords', 'OBViewGrid.body', ksAction_DeleteSelectedRecords);
 
-    var ksAction_EditInGrid = function(){
+    ksAction_EditInGrid = function () {
       if (me.getSelectedRecords().length === 1) {
         me.endEditing();
         me.startEditing(me.getRecordIndex(me.getSelectedRecords()[0]));
@@ -708,7 +710,7 @@
     };
     OB.KeyboardManager.Shortcuts.set('ViewGrid_EditInGrid', 'OBViewGrid.body', ksAction_EditInGrid);
 
-    var ksAction_EditInForm = function(){
+    ksAction_EditInForm = function () {
       if (me.getSelectedRecords().length === 1) {
         me.endEditing();
         me.view.editRecord(me.getSelectedRecords()[0]);
@@ -719,7 +721,7 @@
     };
     OB.KeyboardManager.Shortcuts.set('ViewGrid_EditInForm', 'OBViewGrid.body', ksAction_EditInForm);
 
-    var ksAction_CancelChanges = function() {
+    ksAction_CancelChanges = function () {
       me.view.undo();
       return false;
     };
@@ -727,8 +729,8 @@
 
     this.Super('enableShortcuts', arguments);
   },
-  
-  deselectAllRecords: function(preventUpdateSelectInfo, autoSaveDone){
+
+  deselectAllRecords: function (preventUpdateSelectInfo, autoSaveDone) {
     // if there is nothing to deselect then don't deselect
     if (!this.getSelectedRecord()) {
       return;
@@ -742,7 +744,7 @@
       this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
       return;
     }
-    
+
     this.allSelected = false;
     var ret = this.Super('deselectAllRecords', arguments);
     this.lastSelectedRecord = null;
@@ -751,8 +753,8 @@
     }
     return ret;
   },
-  
-  selectAllRecords: function(autoSaveDone){
+
+  selectAllRecords: function (autoSaveDone) {
     if (!autoSaveDone) {
       var actionObject = {
         target: this,
@@ -767,13 +769,14 @@
     this.selectionUpdated();
     return ret;
   },
-  
-  updateRowCountDisplay: function(delayed){
+
+  updateRowCountDisplay: function (delayed) {
     if (!delayed) {
       this.delayCall('updateRowCountDisplay', [true], 100);
       return;
     }
-    var newValue = '', length = this.data.getLength();
+    var newValue = '',
+        length = this.data.getLength();
     if (length > this.dataPageSize) {
       newValue = '>' + this.dataPageSize;
     } else if (length === 0) {
@@ -786,13 +789,13 @@
       this.filterEditor.getEditForm().getField(isc.OBViewGrid.EDIT_LINK_FIELD_NAME).defaultValue = newValue;
     }
   },
-  
-  refreshContents: function(callback){
-    var selectedValues;
-    
+
+  refreshContents: function (callback) {
+    var selectedValues, context;
+
     this.resetEmptyMessage();
     this.view.updateTabTitle();
-    
+
     // do not refresh if the parent is not selected and we have no data
     // anyway
     if (this.view.parentProperty && (!this.data || !this.data.getLength || this.data.getLength() === 0)) {
@@ -808,13 +811,13 @@
         return;
       }
     }
-    
-    var context = {
+
+    context = {
       showPrompt: false
     };
     this.filterData(this.getCriteria(), callback, context);
   },
-  
+
   // the dataarrived method is where different actions are done after
   // data has arrived in the grid:
   // - open the edit view if default edit mode is enabled
@@ -823,33 +826,28 @@
   // opening the relevant record is done here or if no record is passed grid
   // mode is opened
   // - if there is only one record then select it directly
-  dataArrived: function(startRow, endRow){
+  dataArrived: function (startRow, endRow) {
     // do this now, to replace the loading message
     // TODO: add dynamic part of readonly (via setWindowSettings: see issue 17441)
     if (this.uiPattern === 'SR' || this.uiPattern === 'RO') {
       this.noDataEmptyMessage = '<span class="OBGridNotificationText">' + OB.I18N.getLabel('OBUIAPP_NoDataInGrid') + '</span>';
     } else {
-      this.noDataEmptyMessage = '<span class="OBGridNotificationText">' + OB.I18N.getLabel('OBUIAPP_GridNoRecords') + '</span>' +
-      '<span onclick="window[\'' +
-      this.ID +
-      '\'].view.newRow();" class="OBLinkButtonItem">' +
-      OB.I18N.getLabel('OBUIAPP_GridCreateOne') +
-      '</span>';
+      this.noDataEmptyMessage = '<span class="OBGridNotificationText">' + OB.I18N.getLabel('OBUIAPP_GridNoRecords') + '</span>' + '<span onclick="window[\'' + this.ID + '\'].view.newRow();" class="OBLinkButtonItem">' + OB.I18N.getLabel('OBUIAPP_GridCreateOne') + '</span>';
     }
     this.resetEmptyMessage();
-    
+
     var record, ret = this.Super('dataArrived', arguments);
     this.updateRowCountDisplay();
     if (this.getSelectedRecords() && this.getSelectedRecords().length > 0) {
       this.selectionUpdated();
     }
-    
+
     // no data and the grid is not visible, only do this is if the 
     // form is not in new mode
     if (this.data && this.data.getLength() === 0 && !this.isVisible() && !this.view.viewForm.isNew) {
       this.makeVisible();
     }
-    
+
     // get the record id from any record
     if (this.isOpenDirectMode && this.data && this.data.getLength() >= 1) {
       // now tell the parent grid to refresh on the basis of this parentRecordId also
@@ -866,7 +864,7 @@
       }
     }
     delete this.isOpenDirectMode;
-    
+
     if (this.targetOpenNewEdit) {
       delete this.targetOpenNewEdit;
       // not passing record opens new
@@ -900,24 +898,24 @@
         this.lastSelectedRecord = null;
       }
     }
-    
+
     if (this.actionAfterDataArrived) {
       this.actionAfterDataArrived();
       this.actionAfterDataArrived = null;
     }
-    
+
     return ret;
   },
-  
+
   // overridden to prevent the filter editor fields from using the 
   // grids datasource
-  getFilterEditorProperties: function(field){
+  getFilterEditorProperties: function (field) {
     return isc.addProperties({
       optionDataSource: null
     }, this.Super('getFilterEditorProperties', arguments));
   },
-  
-  refreshGrid: function(callback){
+
+  refreshGrid: function (callback) {
     if (this.getSelectedRecord()) {
       this.targetRecordId = this.getSelectedRecord()[OB.Constants.ID];
       // as the record is already selected it is already in the filter
@@ -925,16 +923,17 @@
     }
     this.actionAfterDataArrived = callback;
     this.invalidateCache();
-    
+
     var context = {
       showPrompt: false
     };
     this.filterData(this.getCriteria(), null, context);
   },
-  
+
   // with a delay to handle the target record when the body has been drawn
-  delayedHandleTargetRecord: function(startRow, endRow){
-    var rowTop, recordIndex, i, data = this.data, tmpTargetRecordId = this.targetRecordId;
+  delayedHandleTargetRecord: function (startRow, endRow) {
+    var rowTop, recordIndex, i, data = this.data,
+        tmpTargetRecordId = this.targetRecordId;
     if (!this.targetRecordId) {
       return;
     }
@@ -944,26 +943,26 @@
       delete this.notRemoveFilter;
 
       var gridRecord = data.find(OB.Constants.ID, tmpTargetRecordId);
-      
+
       // no grid record found, stop here
       if (!gridRecord) {
         return;
       }
       recordIndex = this.getRecordIndex(gridRecord);
-      
+
       if (data.criteria) {
         data.criteria._targetRecordId = null;
       }
-      
+
       this.doSelectSingleRecord(gridRecord);
 
       this.scrollCellIntoView(recordIndex, null, true, true);
-      
+
       // show the form with the selected record
       if (!this.view.isShowingForm && this.isOpenDirectModeLeaf) {
         this.view.editRecord(gridRecord);
       }
-      
+
       delete this.isOpenDirectModeLeaf;
       delete this.isOpenDirectModeParent;
 
@@ -972,14 +971,14 @@
       this.delayCall('delayedHandleTargetRecord', [startRow, endRow], 200, this);
     }
   },
-  
-  selectRecordById: function(id, forceFetch){
+
+  selectRecordById: function (id, forceFetch) {
     if (forceFetch) {
       this.targetRecordId = id;
       this.filterData(this.getCriteria());
       return;
     }
-    
+
     var recordIndex, gridRecord = this.data.find(OB.Constants.ID, id);
     // no grid record fetch it
     if (!gridRecord) {
@@ -991,43 +990,46 @@
     this.scrollRecordIntoView(recordIndex, true);
     this.doSelectSingleRecord(gridRecord);
   },
-  
-  filterData: function(criteria, callback, requestProperties){
+
+  filterData: function (criteria, callback, requestProperties) {
+    var theView = this.view,
+        newCallBack;
+
     if (!requestProperties) {
       requestProperties = {};
     }
     requestProperties.showPrompt = false;
-    
-    var theView = this.view;
-    var newCallBack = function(){
+
+    newCallBack = function () {
       theView.recordSelected();
       if (callback) {
         callback();
       }
     };
-    
+
     return this.Super('filterData', [this.convertCriteria(criteria), newCallBack, requestProperties]);
   },
-  
-  fetchData: function(criteria, callback, requestProperties){
+
+  fetchData: function (criteria, callback, requestProperties) {
+    var theView = this.view,
+        newCallBack;
+
     if (!requestProperties) {
       requestProperties = {};
     }
     requestProperties.showPrompt = false;
-    
-    var theView = this.view;
-    
-    var newCallBack = function(){
+
+    newCallBack = function () {
       theView.recordSelected();
       if (callback) {
         callback();
       }
     };
-    
+
     return this.Super('fetchData', [this.convertCriteria(criteria), newCallBack, requestProperties]);
   },
-  
-  handleFilterEditorSubmit: function(criteria, context, autoSaveDone){
+
+  handleFilterEditorSubmit: function (criteria, context, autoSaveDone) {
     if (!autoSaveDone) {
       var actionObject = {
         target: this,
@@ -1037,16 +1039,16 @@
       this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
       return;
     }
-    
+
     this.Super('handleFilterEditorSubmit', arguments);
   },
-  
-  getInitialCriteria: function(){
-    var criteria = this.Super('getInitialCriteria', arguments);   
+
+  getInitialCriteria: function () {
+    var criteria = this.Super('getInitialCriteria', arguments);
     return this.convertCriteria(criteria);
   },
-  
-  getCriteria: function(){
+
+  getCriteria: function () {
     var criteria = this.Super('getCriteria', arguments) || {};
     if ((criteria === null || !criteria.criteria) && this.initialCriteria) {
       criteria = isc.shallowClone(this.initialCriteria);
@@ -1054,35 +1056,35 @@
     criteria = this.convertCriteria(criteria);
     return criteria;
   },
-    
-  convertCriteria: function(criteria){
-    var selectedValues, prop, fld, value, i, 
-      criterion, fldName, length;
+
+  convertCriteria: function (criteria) {
+    var selectedValues, prop, fld, value, i, criterion, fldName, length;
 
     if (!criteria) {
-      criteria = {};      
+      criteria = {};
     } else {
       criteria = isc.clone(criteria);
     }
-    
+
     if (!criteria.operator) {
       criteria.operator = 'and';
     }
     if (!criteria._constructor) {
-      criteria._constructor = "AdvancedCriteria"; 
+      criteria._constructor = "AdvancedCriteria";
     }
-    
+
     if (!criteria.criteria) {
       criteria.criteria = [];
     }
-    
+
     if (!this.notRemoveFilter && this.targetRecordId) {
       // do not filter on anything with a targetrecord
       criteria = {
-        operator: 'and', 
-        _constructor: "AdvancedCriteria", 
-        criteria:[]};
-        
+        operator: 'and',
+        _constructor: "AdvancedCriteria",
+        criteria: []
+      };
+
       // add a dummy criteria to force a fetch
       criteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
     } else if (this.forceRefresh) {
@@ -1099,10 +1101,10 @@
         }
       }
     }
-    
+
     // note pass in criteria otherwise infinite looping!
     this.resetEmptyMessage(criteria);
-    
+
     if (this.view.parentProperty && !this.isOpenDirectMode) {
       selectedValues = this.view.parentView.viewGrid.getSelectedRecords();
       var parentPropertyFilterValue = -1;
@@ -1115,9 +1117,9 @@
           parentPropertyFilterValue = selectedValues[0][OB.Constants.ID];
         }
       }
-      
+
       this.view.parentRecordId = parentPropertyFilterValue;
-      
+
       var fnd = false;
       var innerCriteria = criteria.criteria;
       length = innerCriteria.length;
@@ -1139,7 +1141,7 @@
         });
       }
     }
-    
+
     // get rid of some unneeded stuff in the criteria
     if (criteria && criteria.criteria) {
       var internalCriteria = criteria.criteria;
@@ -1162,22 +1164,22 @@
 
     return criteria;
   },
-  
-  onFetchData: function(criteria, requestProperties) {    
+
+  onFetchData: function (criteria, requestProperties) {
     requestProperties = requestProperties || {};
     requestProperties.params = this.getFetchRequestParams(requestProperties.params);
   },
-  
-  getFetchRequestParams: function(params) {
+
+  getFetchRequestParams: function (params) {
     params = params || {};
-    
+
     if (this.targetRecordId) {
       params._targetRecordId = this.targetRecordId;
       if (!this.notRemoveFilter) {
         // remove the filter clause we don't want to use it anymore
         this.filterClause = null;
       }
-      
+
       // this mode means that no parent is selected but the parent needs to be 
       // determined from the target record and the parent property
       if (this.isOpenDirectMode && this.view.parentView) {
@@ -1189,14 +1191,14 @@
 
     // prevent the count operation
     params[isc.OBViewGrid.NO_COUNT_PARAMETER] = 'true';
-    
+
     if (this.orderByClause) {
       params[OB.Constants.ORDERBY_PARAMETER] = this.orderByClause;
     }
 
     // add all the new session properties context info to the requestProperties
     isc.addProperties(params, this.view.getContextInfo(true, false));
-          
+
     if (this.filterClause) {
       if (this.whereClause) {
         params[OB.Constants.WHERE_PARAMETER] = ' ((' + this.whereClause + ') and (' + this.filterClause + ")) ";
@@ -1208,23 +1210,23 @@
     } else {
       params[OB.Constants.WHERE_PARAMETER] = null;
     }
-    return params;    
+    return params;
   },
-  
-  createNew: function(){
+
+  createNew: function () {
     this.view.editRecord();
   },
-  
-  makeVisible: function() {
+
+  makeVisible: function () {
     if (this.view.isShowingForm) {
       this.view.switchFormGridVisibility();
     } else {
       this.show();
     }
   },
-  
+
   // determine which field can be autoexpanded to use extra space
-  getAutoFitExpandField: function() {    
+  getAutoFitExpandField: function () {
     var ret, i, length;
     length = this.view.autoExpandFieldNames.length;
     for (i = 0; i < length; i++) {
@@ -1233,12 +1235,12 @@
         return field.name;
       }
     }
-    ret = this.Super('getAutoFitExpandField', arguments);    
+    ret = this.Super('getAutoFitExpandField', arguments);
     return ret;
   },
-  
-  recordClick: function(viewer, record, recordNum, field, fieldNum, value, rawValue){
-    var textDeselectInterval = setInterval(function() { //To ensure that if finally a double click (recordDoubleClick) is executed, no work is highlighted/selected
+
+  recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue) {
+    var textDeselectInterval = setInterval(function () { //To ensure that if finally a double click (recordDoubleClick) is executed, no work is highlighted/selected
       if (document.selection && document.selection.empty) {
         document.selection.empty();
       } else if (window.getSelection) {
@@ -1246,7 +1248,7 @@
         sel.removeAllRanges();
       }
     }, 15);
-    setTimeout(function() {
+    setTimeout(function () {
       clearInterval(textDeselectInterval);
     }, 350);
     var actionObject = {
@@ -1257,7 +1259,7 @@
     this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
   },
 
-  recordDoubleClick: function(viewer, record, recordNum, field, fieldNum, value, rawValue){
+  recordDoubleClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue) {
     var actionObject = {
       target: this.view,
       method: this.view.editRecord,
@@ -1265,8 +1267,8 @@
     };
     this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
   },
-  
-  resetEmptyMessage: function(criteria){
+
+  resetEmptyMessage: function (criteria) {
     var selectedValues, parentIsNew, oldMessage = this.emptyMessage;
     criteria = criteria || this.getCriteria();
     if (!this.view) {
@@ -1293,11 +1295,10 @@
       this.markForRedraw();
     }
   },
-  
+
   // +++++++++++++++++++++++++++++ Context menu on record click +++++++++++++++++++++++
-  
-  cellContextClick: function(record, rowNum, colNum){
-    
+  cellContextClick: function (record, rowNum, colNum) {
+
     // don't do anything if right-clicking on a selected record
     if (!this.isSelected(record)) {
       this.handleRecordSelection(null, record, rowNum, null, colNum, null, null, true);
@@ -1308,7 +1309,7 @@
     return ret;
   },
 
-  makeCellContextItems: function(record, rowNum, colNum){
+  makeCellContextItems: function (record, rowNum, colNum) {
     var sourceWindow = this.view.standardWindow.windowId;
     var menuItems = [];
     var recordsSelected = this.getSelectedRecords().length > 0;
@@ -1318,8 +1319,8 @@
     if (!this.view.hasNotChanged() || this.view.viewGrid.hasErrors()) {
       menuItems.add({
         title: OB.I18N.getLabel('OBUIAPP_UndoChanges'),
-        keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text','Grid_CancelChanges','id'),
-        click: function(){
+        keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text', 'Grid_CancelChanges', 'id'),
+        click: function () {
           grid.view.undo();
         }
       });
@@ -1328,8 +1329,8 @@
     if (singleSelected && this.canEdit && this.isWritable(record) && !this.view.readOnly) {
       menuItems.add({
         title: OB.I18N.getLabel('OBUIAPP_EditInGrid'),
-        keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text','ViewGrid_EditInGrid','id'),
-        click: function(){
+        keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text', 'ViewGrid_EditInGrid', 'id'),
+        click: function () {
           grid.endEditing();
           if (colNum || colNum === 0) {
             grid.forceFocusColumn = grid.getField(colNum).name;
@@ -1337,34 +1338,22 @@
           grid.startEditing(rowNum, colNum);
         }
       });
-//      menuItems.add({
-//        title: OB.I18N.getLabel('OBUIAPP_EditInForm'),
-//        click: function(){
-//          grid.endEditing();
-//          grid.view.editRecord(record);
-//        }
-//      });
     }
 
     if (!this.view.singleRecord && !this.view.readOnly) {
       menuItems.add({
         title: OB.I18N.getLabel('OBUIAPP_CreateRecordInGrid'),
-        keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text','ToolBar_NewRow','id'),
-        click: function(){
+        keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text', 'ToolBar_NewRow', 'id'),
+        click: function () {
           grid.startEditingNew(rowNum);
         }
       });
     }
-//    menuItems.add({
-//      title: OB.I18N.getLabel('OBUIAPP_CreateRecordInForm'),
-//      click: function(){
-//        grid.view.newDocument();
-//      }
-//    });
+
     if (singleSelected && field.canFilter) {
       menuItems.add({
         title: OB.I18N.getLabel('OBUIAPP_UseAsFilter'),
-        click: function(){
+        click: function () {
           var value;
           // a foreign key field, use the displayfield/identifier
           if (field.fkField && field.displayField) {
@@ -1387,7 +1376,7 @@
     if (singleSelected && field.fkField) {
       menuItems.add({
         title: OB.I18N.getLabel('OBUIAPP_OpenOnTab'),
-        click: function(){
+        click: function () {
           var fldName = field.name;
           var dotIndex = fldName.indexOf('.');
           if (dotIndex !== -1) {
@@ -1400,31 +1389,31 @@
     if (recordsSelected && !this.view.readOnly && !this.view.singleRecord && this.allSelectedRecordsWritable()) {
       menuItems.add({
         title: OB.I18N.getLabel('OBUIAPP_Delete'),
-        keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text','ToolBar_Eliminate','id'),
-        click: function(){
+        keyTitle: OB.KeyboardManager.Shortcuts.getProperty('keyComb.text', 'ToolBar_Eliminate', 'id'),
+        click: function () {
           grid.view.deleteSelectedRows();
         }
       });
     }
-    
+
     return menuItems;
   },
-  
+
   // +++++++++++++++++++++++++++++ Record Selection Handling +++++++++++++++++++++++
-  
-  updateSelectedCountDisplay: function(){
-    var selection = this.getSelection(), fld, grid = this;
+  updateSelectedCountDisplay: function () {
+    var selection = this.getSelection(),
+        fld, grid = this;
     var selectionLength = selection.getLength();
     var newValue = '&nbsp;';
     if (selectionLength > 0) {
       newValue = selectionLength;
-      
+
       if (this.filterEditor && this.filterEditor.getEditForm()) {
         fld = this.filterEditor.getEditForm().getField(this.getCheckboxField().name);
         if (fld && !fld.clickForSelectedRow) {
           fld.clickForSelectedRow = true;
           fld.originalClick = fld.click;
-          fld.click = function() {
+          fld.click = function () {
             if (grid.getSelection().getLength() === 0) {
               return;
             }
@@ -1432,7 +1421,7 @@
             // do redraw as first columns with buttons are not drawn
             grid.markForRedraw();
           };
-          fld.itemHoverHTML = function() {
+          fld.itemHoverHTML = function () {
             return OB.I18N.getLabel('OBUIAPP_ClickSelectedCount');
           };
         }
@@ -1453,16 +1442,16 @@
       this.filterEditor.getEditForm().getField(this.getCheckboxField().name).defaultValue = newValue;
     }
   },
-  
+
   // note when solving selection issues in the future also
   // consider using the selectionChanged method, but that
   // one has as disadvantage that it is called multiple times
   // for one select/deselect action
-  selectionUpdated: function(record, recordList){
+  selectionUpdated: function (record, recordList) {
     if ((!recordList || recordList.length === 1) && record === this.lastSelectedRecord && (this.lastSelectedRecord || record)) {
       return;
     }
-  
+
     // close any editors, but only if it is different from the one we are editing
     if (this.isEditingGrid) {
       var editRecord = this.getRecord(this.getEditRow());
@@ -1479,12 +1468,13 @@
       this.lastSelectedRecord = this.getSelectedRecord();
     }
   },
-  
-  selectOnMouseDown: function(record, recordNum, fieldNum, autoSaveDone){
+
+  selectOnMouseDown: function (record, recordNum, fieldNum, autoSaveDone) {
     // don't change selection on right mouse down
-    var EH = isc.EventHandler, eventType = EH.getEventType();
+    var EH = isc.EventHandler,
+        eventType = EH.getEventType();
     this.wasEditing = this.view.isEditingGrid;
-    
+
     // don't do anything if right-clicking on a selected record
     if (EH.rightButtonDown() && this.isSelected(record)) {
       return;
@@ -1494,7 +1484,7 @@
     // a mouse event, in other cases the autosave is done as part of the recordclick
     // which is called for a mousedown also
     var passToAutoSave = this.getCheckboxFieldPosition() === fieldNum || !EH.isMouseEvent(eventType);
-    
+
     if (!autoSaveDone && passToAutoSave) {
       var actionObject = {
         target: this,
@@ -1510,7 +1500,7 @@
       //        this.setActionAfterAutoSave(this, this.selectOnMouseDown, arguments);
       //      }
     }
-    
+
     var previousSingleRecordSelection = this.singleRecordSelection;
     var currentSelectedRecordSelected = (this.getSelectedRecord() === record);
     if (this.getCheckboxFieldPosition() === fieldNum) {
@@ -1519,7 +1509,7 @@
       }
       this.singleRecordSelection = false;
       this.Super('selectOnMouseDown', arguments);
-      
+
       // handle a special case:
       // - singlerecordmode: checkbox is not checked
       // - user clicks on checkbox
@@ -1527,9 +1517,9 @@
       if (previousSingleRecordSelection && currentSelectedRecordSelected) {
         this.selectSingleRecord(record);
       }
-      
+
       this.selectionUpdated();
-      
+
       this.markForRedraw('Selection checkboxes need to be redrawn');
     } else {
       // do some checking, the handleRecordSelection should only be called
@@ -1543,13 +1533,13 @@
       }
     }
   },
-  
-  handleRecordSelection: function(viewer, record, recordNum, field, fieldNum, value, rawValue, fromSelectOnMouseDown){
+
+  handleRecordSelection: function (viewer, record, recordNum, field, fieldNum, value, rawValue, fromSelectOnMouseDown) {
     var wasEditing = this.wasEditing;
     delete this.wasEditing;
     var EH = isc.EventHandler;
     var keyName = EH.getKey();
-    
+
     // stop editing if the user clicks out of the row
     if ((this.getEditRow() || this.getEditRow() === 0) && this.getEditRow() !== recordNum) {
       this.endEditing();
@@ -1559,17 +1549,17 @@
     if ((this.getEditRow() || this.getEditRow() === 0) && this.getEditRow() === recordNum) {
       return;
     }
-    
+
     // if the arrow key was pressed and no ctrl/shift pressed then
     // go to single select mode
     var arrowKeyPressed = keyName && (keyName === isc.OBViewGrid.ARROW_UP_KEY_NAME || keyName === isc.OBViewGrid.ARROW_DOWN_KEY_NAME);
-    
+
     var previousSingleRecordSelection = this.singleRecordSelection;
     if (arrowKeyPressed) {
       if ((EH.ctrlKeyDown() && !EH.altKeyDown() && !EH.shiftKeyDown()) || (!EH.ctrlKeyDown() && !EH.altKeyDown() && EH.shiftKeyDown())) {
         // move to multi-select mode, let the standard do it for us
         this.singleRecordSelection = false;
-      } else if (!(!EH.ctrlKeyDown() && EH.altKeyDown() && EH.shiftKeyDown())) {  // 'if' statement to avoid do an action when the KS to move to a child tab is fired
+      } else if (!(!EH.ctrlKeyDown() && EH.altKeyDown() && EH.shiftKeyDown())) { // 'if' statement to avoid do an action when the KS to move to a child tab is fired
         this.doSelectSingleRecord(record);
       }
     } else if (this.getCheckboxFieldPosition() === fieldNum) {
@@ -1601,15 +1591,15 @@
     } else {
       // click on the record which was already selected
       this.doSelectSingleRecord(record);
-      
+
       // if we were editing then a single click continue edit mode
       if (wasEditing) {
         // set the focus in the clicked cell
-        this.forceFocusColumn = this.getField(fieldNum).name;        
+        this.forceFocusColumn = this.getField(fieldNum).name;
         this.startEditing(recordNum, fieldNum);
       }
     }
-    
+
     this.updateSelectedCountDisplay();
     this.view.toolBar.updateButtonState(true);
 
@@ -1620,13 +1610,13 @@
       this.markForRedraw('Selection checkboxes need to be redrawn');
     }
   },
-  
-  selectRecordForEdit: function(record){
+
+  selectRecordForEdit: function (record) {
     this.Super('selectRecordForEdit', arguments);
     this.doSelectSingleRecord(record);
   },
-  
-  doSelectSingleRecord: function(record){
+
+  doSelectSingleRecord: function (record) {
     // if this record is already selected and the only one then do nothing
     // note that when navigating with the arrow key that at a certain 2 are
     // selected
@@ -1636,18 +1626,19 @@
     }
     this.singleRecordSelection = true;
     this.selectSingleRecord(record);
-    
+
     // deselect the checkbox in the top
-    var fieldNum = this.getCheckboxFieldPosition(), field = this.fields[fieldNum];
+    var fieldNum = this.getCheckboxFieldPosition(),
+        field = this.fields[fieldNum];
     var icon = this.checkboxFieldFalseImage || this.booleanFalseImage;
     var title = this.getValueIconHTML(icon, field);
-    
+
     this.setFieldTitle(fieldNum, title);
   },
-  
+
   // overridden to prevent the checkbox to be shown when only one
   // record is selected.
-  getCellValue: function(record, recordNum, fieldNum, gridBody){
+  getCellValue: function (record, recordNum, fieldNum, gridBody) {
     var field = this.fields[fieldNum];
     if (!field || this.allSelected) {
       return this.Super('getCellValue', arguments);
@@ -1669,34 +1660,33 @@
       if (!record || record[this.recordEnabledProperty] === false) {
         icon = icon.replace('.', '_Disabled.');
       }
-      
+
       var html = this.getValueIconHTML(icon, field);
-      
+
       return html;
     } else {
       return this.Super('getCellValue', arguments);
     }
   },
-  
-  getSelectedRecords: function(){
+
+  getSelectedRecords: function () {
     return this.getSelection();
   },
 
   // +++++++++++++++++ functions for grid editing +++++++++++++++++
-
   startEditing: function (rowNum, colNum, suppressFocus, eCe, suppressWarning) {
     var i, ret, fld, length = this.getFields().length;
     // 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))  {
+    if ((rowNum || rowNum === 0) && (!colNum && colNum !== 0) && this.rowHasErrors(rowNum)) {
       for (i = 0; i < length; i++) {
         if (this.cellHasErrors(rowNum, i)) {
-         colNum = i;
-         break; 
+          colNum = i;
+          break;
         }
       }
     }
-    
+
     if (colNum || colNum === 0) {
       this.forceFocusColumn = this.getField(colNum).name;
     } else {
@@ -1705,7 +1695,7 @@
         if (this.getFields()[i].editorProperties && this.getFields()[i].editorProperties.firstFocusedField) {
           colNum = i;
         }
-      }    
+      }
       if (colNum < length && this.getFields()[colNum].disabled) {
         for (i = 0; i < length; i++) {
           if (this.getFields()[i].editorProperties && !this.getFields()[i].disabled && this.getFields()[i].visible) {
@@ -1715,15 +1705,15 @@
         }
       }
     }
-    
+
     ret = this.Super('startEditing', [rowNum, colNum, suppressFocus, eCe, suppressWarning]);
-    
+
     this.recomputeCanvasComponents(rowNum);
-    
+
     return ret;
   },
-  
-  startEditingNew: function(rowNum){
+
+  startEditingNew: function (rowNum) {
     // several cases:
     // - no current rows, add at position 0
     // - row selected, add row after selected row
@@ -1734,7 +1724,7 @@
       if (!this.getSelectedRecord()) {
         insertRow = this.getTotalRows();
       } else {
-        insertRow = 1 + this.getRecordIndex(this.getSelectedRecord()); 
+        insertRow = 1 + this.getRecordIndex(this.getSelectedRecord());
       }
     } else {
       insertRow = rowNum + 1;
@@ -1744,9 +1734,9 @@
     this.recomputeCanvasComponents(insertRow);
     this.view.refreshChildViews();
   },
-  
+
   // recompute recordcomponents
-  recomputeCanvasComponents: function(rowNum) {
+  recomputeCanvasComponents: function (rowNum) {
     var i, fld, length = this.getFields().length;
 
     // remove client record components in edit mode
@@ -1757,8 +1747,8 @@
       }
     }
   },
-  
-  initializeEditValues: function(rowNum, colNum){
+
+  initializeEditValues: function (rowNum, colNum) {
     var record = this.getRecord(rowNum);
     // no record create one
     if (!record) {
@@ -1766,28 +1756,28 @@
     }
     return this.Super('initializeEditValues', arguments);
   },
-  
-  createNewRecordForEditing: function(rowNum){
+
+  createNewRecordForEditing: function (rowNum) {
     // note: the id is dummy, will be replaced when the save succeeds, 
     // it MUST start with _ to identify it is a temporary id 
     var record = {
       _new: true,
       id: '_' + new Date().getTime()
     };
-    
+
     this.data.insertCacheData(record, rowNum);
     this.scrollToRow(rowNum);
     this.updateRowCountDisplay();
     this.view.toolBar.updateButtonState(true);
-    
+
     // do it with a delay to give the system time to set the record information
     this.markForRedraw();
   },
-  
-  editFailed: function(rowNum, colNum, newValues, oldValues, editCompletionEvent, dsResponse, dsRequest){
-    var record = this.getRecord(rowNum), editRow, editSession;
-    var view = this.view;
-    
+
+  editFailed: function (rowNum, colNum, newValues, oldValues, editCompletionEvent, dsResponse, dsRequest) {
+    var record = this.getRecord(rowNum),
+        editRow, editSession, view = this.view;
+
     // set the default error message, 
     // is possibly overridden in the next call
     if (record) {
@@ -1799,33 +1789,34 @@
         record[this.recordBaseStyleProperty] = this.recordStyleError;
       }
     }
-    
+
     if (!this.isVisible()) {
       isc.warn(OB.I18N.getLabel('OBUIAPP_TabWithErrors', [this.view.tabTitle]));
     } else if (view.standardWindow.forceDialogOnFailure && !this.view.isActiveView) {
       isc.warn(OB.I18N.getLabel('OBUIAPP_AutoSaveError', [this.view.tabTitle]));
     }
-    
+
     view.standardWindow.cleanUpAutoSaveProperties();
     view.updateTabTitle();
     view.toolBar.updateButtonState(true);
-    
+
     // if nothing else got selected, select ourselves then
     if (record && !this.getSelectedRecord()) {
       this.selectRecord(record);
     }
   },
-  
-  editComplete: function(rowNum, colNum, newValues, oldValues, editCompletionEvent, dsResponse){
 
-    var record = this.getRecord(rowNum), editRow, editSession, autoSaveAction;
-    
+  editComplete: function (rowNum, colNum, newValues, oldValues, editCompletionEvent, dsResponse) {
+
+    var record = this.getRecord(rowNum),
+        editRow, editSession, autoSaveAction;
+
     // a new id has been computed use that now    
     if (record && record._newId) {
       record.id = record._newId;
       delete record._newId;
     }
-    
+
     // during save the record looses the link to the editColumnLayout,
     // restore it
     if (oldValues.editColumnLayout && !record.editColumnLayout) {
@@ -1837,13 +1828,13 @@
       record.editColumnLayout.editButton.setErrorState(false);
       record.editColumnLayout.showEditOpen();
     }
-    
+
     // remove any new pointer
     delete record._new;
-    
+
     // success invoke the action, if any there
     this.view.standardWindow.autoSaveDone(this.view, true);
-    
+
     // if nothing else got selected, select ourselves then
     if (!this.getSelectedRecord()) {
       this.selectRecord(record);
@@ -1851,7 +1842,7 @@
     } else if (this.getSelectedRecord() === record) {
       this.view.refreshChildViews();
     }
-    
+
     // remove the error style/message
     this.setRecordErrorMessage(rowNum, null);
     // update after the error message has been removed
@@ -1862,9 +1853,10 @@
     this.refreshRow(rowNum);
   },
 
-  undoEditSelectedRows: function(){
-    var selectedRecords = this.getSelectedRecords(), 
-      toRemove = [], i, length = selectedRecords.length;
+  undoEditSelectedRows: function () {
+    var selectedRecords = this.getSelectedRecords(),
+        toRemove = [],
+        i, length = selectedRecords.length;
     for (i = 0; i < length; i++) {
       var rowNum = this.getRecordIndex(selectedRecords[i]);
       var record = selectedRecords[i];
@@ -1890,7 +1882,7 @@
     this.view.updateTabTitle();
     this.view.toolBar.updateButtonState(true);
   },
-  
+
   getCellStyle: function (record, rowNum, colNum) {
     // inactive, selected
     if (record && record[this.recordCustomStyleProperty]) {
@@ -1903,12 +1895,13 @@
 
     return this.Super('getCellStyle', arguments);
   },
-  
+
   // prevent multi-line content to show strangely
   // https://issues.openbravo.com/view.php?id=17531
-  formatDisplayValue: function(value, record, rowNum, colNum) {
-    var fld = this.getFields()[colNum], index;
-    
+  formatDisplayValue: function (value, record, rowNum, colNum) {
+    var fld = this.getFields()[colNum],
+        index;
+
     if (fld.clientClass) {
       return '';
     }
@@ -1916,23 +1909,24 @@
     if (this.inCellHoverHTML || !isc.isA.String(value)) {
       return value;
     }
-  
+
     index = value.indexOf('\n');
     if (index !== -1) {
       return value.substring(0, index) + '...';
-    } 
-    
+    }
+
     return value;
   },
-  
-  discardEdits: function(rowNum, colNum, dontHideEditor, editCompletionEvent, preventConfirm){
-    var localArguments = arguments, editForm = this.getEditForm(), totalRows;
-    var me = this, record = this.getRecord(rowNum);
-    
-    if (!preventConfirm &&
-    (editForm.hasChanged || this.rowHasErrors(rowNum))) {
+
+  discardEdits: function (rowNum, colNum, dontHideEditor, editCompletionEvent, preventConfirm) {
+    var localArguments = arguments,
+        editForm = this.getEditForm(),
+        totalRows, me = this,
+        record = this.getRecord(rowNum);
+
+    if (!preventConfirm && (editForm.hasChanged || this.rowHasErrors(rowNum))) {
       me.Super('discardEdits', localArguments);
-      
+
       // remove the record if new
       if (record._new) {
         totalRows = me.data.totalRows;
@@ -1950,15 +1944,15 @@
         // remove the error style/msg    
         me.setRecordErrorMessage(rowNum, null);
       }
-      
+
       me.view.standardWindow.cleanUpAutoSaveProperties();
-      
+
       // update after removing the error msg
       me.view.updateTabTitle();
       me.view.toolBar.updateButtonState(true);
     } else {
       me.Super('discardEdits', localArguments);
-      
+
       // remove the record if new
       if (record && record._new) {
         totalRows = me.data.totalRows;
@@ -1976,17 +1970,17 @@
         // remove the error style/msg    
         me.setRecordErrorMessage(rowNum, null);
       }
-      
+
       this.view.standardWindow.cleanUpAutoSaveProperties();
 
       this.refreshRow(rowNum);
-   
+
       // update after removing the error msg
       this.view.updateTabTitle();
     }
   },
-  
-  saveEdits: function(editCompletionEvent, callback, rowNum, colNum, validateOnly, skipValidation){
+
+  saveEdits: function (editCompletionEvent, callback, rowNum, colNum, validateOnly, skipValidation) {
     var ret = this.Super('saveEdits', arguments);
     // save was not done, because there were no changes probably
     if (!ret) {
@@ -1996,13 +1990,15 @@
     }
     return ret;
   },
-  
+
   // check if a fic call needs to be done when leaving a cell and moving to the next
   // row
   // see description in saveEditvalues
   cellEditEnd: function (editCompletionEvent, newValue, ficCallDone, autoSaveDone) {
-    var rowNum = this.getEditRow(), colNum = this.getEditCol();
-    var editForm = this.getEditForm(), focusItem = (editForm ? editForm.getFocusItem() : null);
+    var rowNum = this.getEditRow(),
+        colNum = this.getEditCol();
+    var editForm = this.getEditForm(),
+        focusItem = (editForm ? editForm.getFocusItem() : null);
     // sometimes rowNum and colnum are not set, then don't compute the next cell
     var nextEditCell = ((rowNum || rowNum === 0) && (colNum || colNum === 0) ? this.getNextEditCell(rowNum, colNum, editCompletionEvent) : null);
     var newRow = nextEditCell && nextEditCell[0] !== rowNum;
@@ -2010,10 +2006,10 @@
     var enterKey = editCompletionEvent === 'enter';
     if (!this.view.standardWindow.isAutoSaveEnabled() && !enterKey && !autoSaveDone && newRow && (editForm.hasChanged || editForm.isNew)) {
       var actionObject = {
-          target: this,
-          method: this.cellEditEnd,
-          parameters: [editCompletionEvent, newValue, ficCallDone, true]
-        };
+        target: this,
+        method: this.cellEditEnd,
+        parameters: [editCompletionEvent, newValue, ficCallDone, true]
+      };
       this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
       return;
     }
@@ -2037,7 +2033,7 @@
           };
           return;
         }
-      }      
+      }
     }
     if (newValue) {
       this.Super('cellEditEnd', [editCompletionEvent, newValue]);
@@ -2045,7 +2041,7 @@
       this.Super('cellEditEnd', [editCompletionEvent]);
     }
   },
-  
+
   // overridden to set the enterkeyaction to nextrowstart in cases the current row
   // is the last being edited
   // also sets a flag which is used in canEditCell   
@@ -2063,20 +2059,18 @@
           this.forceFocusColumn = this.getFields()[i].name;
           break;
         }
-      }    
+      }
 
     } 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)) {
+    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;
   },
@@ -2098,7 +2092,7 @@
         }
       }
     }
-    
+
     if (!colNum && colNum !== 0) {
       return false;
     }
@@ -2106,19 +2100,19 @@
     ret = this.Super('canEditCell', arguments);
     return ret;
   },
-      
+
   // saveEditedValues: when saving, first check if a FIC call needs to be done to update to the 
   // latest values. This can happen when the focus is in a field and the save action is
   // done, at that point first try to force a fic call (handleItemChange) and if that
   // indeed happens stop the saveEdit until the fic returns
-  saveEditedValues: function(rowNum, colNum, newValues, oldValues, editValuesID, editCompletionEvent, saveCallback, ficCallDone){
+  saveEditedValues: function (rowNum, colNum, newValues, oldValues, editValuesID, editCompletionEvent, saveCallback, ficCallDone) {
     if (!rowNum && rowNum !== 0) {
       rowNum = this.getEditRow();
     }
     if (!colNum && colNum !== 0) {
       colNum = this.getEditCol();
     }
-    
+
     // nothing changed just fire the calback and bail
     if (!ficCallDone && this.getEditForm() && !this.getEditForm().hasChanged && !this.getEditForm().isNew) {
       if (saveCallback) {
@@ -2126,12 +2120,13 @@
       }
       return true;
     }
-    
+
     if (ficCallDone) {
       // reset the new values as this can have changed because of a fic call
       newValues = this.getEditValues(editValuesID);
     } else {
-      var editForm = this.getEditForm(), focusItem = editForm.getFocusItem();
+      var editForm = this.getEditForm(),
+          focusItem = editForm.getFocusItem();
       if (focusItem && !focusItem.hasPickList) {
         focusItem.blur(focusItem.form, focusItem);
         if (editForm.inFicCall) {
@@ -2148,23 +2143,25 @@
     }
     this.Super('saveEditedValues', [rowNum, colNum, newValues, oldValues, editValuesID, editCompletionEvent, saveCallback]);
     // commented out as it removes an autosave action which is done in the edit complete method
-//    this.view.standardWindow.setDirtyEditForm(null);
+    //    this.view.standardWindow.setDirtyEditForm(null);
   },
-  
-  autoSave: function(){
+
+  autoSave: function () {
     this.storeUpdatedEditorValue();
     this.endEditing();
   },
-  
-  hideInlineEditor: function(focusInBody, suppressCMHide) {
 
-    var rowNum = this.getEditRow(), record = this.getRecord(rowNum), editForm = this.getEditForm();
+  hideInlineEditor: function (focusInBody, suppressCMHide) {
+
+    var rowNum = this.getEditRow(),
+        record = this.getRecord(rowNum),
+        editForm = this.getEditForm();
     this._hidingInlineEditor = true;
     if (record && (rowNum === 0 || rowNum)) {
       if (!this.rowHasErrors(rowNum)) {
         record[this.recordBaseStyleProperty] = null;
       }
-  
+
       if (record && record.editColumnLayout) {
         isc.Log.logDebug('hideInlineEditor has record and editColumnLayout', 'OB');
         record.editColumnLayout.showEditOpen();
@@ -2175,7 +2172,7 @@
       }
       this.view.isEditingGrid = false;
     }
-    
+
     // always hide the clickmask, as it needs to be re-applied
     // this super call needs to be done before clearing the values
     // of the form, as the form value clear will result
@@ -2188,7 +2185,7 @@
       editForm.resetCanFocus();
       // clear all values, as null values in the new row won't overwrite filled form
       // values
-      editForm.clearValues();      
+      editForm.clearValues();
       // clear the errors so that they don't show up at the next row
       editForm.clearErrors();
     }
@@ -2196,19 +2193,19 @@
     delete this._hidingInlineEditor;
     return ret;
   },
-  
-  getEditDisplayValue: function(rowNum, colNum, record){
+
+  getEditDisplayValue: function (rowNum, colNum, record) {
     // somehow this extra call is needed to not restore
     // the old value when the new value is null
     this.storeUpdatedEditorValue();
     return this.Super('getEditDisplayValue', arguments);
   },
-  
-  showInlineEditor: function(rowNum, colNum, newCell, newRow, suppressFocus){
+
+  showInlineEditor: function (rowNum, colNum, newCell, newRow, suppressFocus) {
     var fld;
-    
+
     this._showingEditor = true;
-    
+
     if (newRow) {
       if (this.getEditForm()) {
         this.getEditForm().clearErrors();
@@ -2217,14 +2214,14 @@
       // and won't be disabled so the user can already start typing      
       suppressFocus = true;
     }
-    
+
     var ret = this.Super('showInlineEditor', [rowNum, colNum, newCell, newRow, suppressFocus]);
-    
+
     if (!newRow) {
       delete this._showingEditor;
       return ret;
     }
-    
+
     if (this.forceFocusColumn) {
       // set the field to focus on after returning from the fic
       this.getEditForm().forceFocusedField = this.forceFocusColumn;
@@ -2233,49 +2230,49 @@
       fld = this.getField(colNum);
       this.getEditForm().forceFocusedField = fld.name;
     }
-    
+
     var record = this.getRecord(rowNum);
-    
+
     this.view.isEditingGrid = true;
-    
+
     record[this.recordBaseStyleProperty] = this.baseStyleEdit;
-    
+
     // also called in case of new
     var form = this.getEditForm();
-    
+
     // also make sure that the new indicator is send to the server
     if (record._new) {
       form.setValue('_new', true);
     }
-    
+
     form.doEditRecordActions(false, record._new && !record._editedBefore);
     record._editedBefore = true;
-    
+
     // must be done after doEditRecordActions    
     if (this.rowHasErrors(rowNum)) {
       this.getEditForm().setErrors(this.getRowValidationErrors(rowNum));
       this.view.standardWindow.setDirtyEditForm(form);
     }
-    
+
     if (record && record.editColumnLayout) {
       record.editColumnLayout.showSaveCancel();
     }
-    
+
     this.view.messageBar.hide();
-    
+
     delete this._showingEditor;
     return ret;
   },
-  
-  closeAnyOpenEditor: function(){
+
+  closeAnyOpenEditor: function () {
     delete this.wasEditing;
     // close any editors we may have
     if (this.getEditRow() || this.getEditRow() === 0) {
       this.endEditing();
     }
   },
-  
-  validateField: function(field, validators, value, record, options){
+
+  validateField: function (field, validators, value, record, options) {
     // Smartclient passes in the grid field, use the editform field
     // as it contains the latest valuemap
     var editField = this.getEditForm().getField(field.name) || field;
@@ -2283,8 +2280,9 @@
     return ret;
   },
 
-  refreshEditRow: function(){
-    var editRow = this.view.viewGrid.getEditRow(), i, length;
+  refreshEditRow: function () {
+    var editRow = this.view.viewGrid.getEditRow(),
+        i, length;
     if (editRow || editRow === 0) {
       // don't refresh the frozen fields, this give strange
       // styling issues in chrome
@@ -2301,7 +2299,7 @@
   // on an item. On items with a picklist this causes calls to the
   // server side
   //  https://issues.openbravo.com/view.php?id=16611
-  getEditItem: function() {
+  getEditItem: function () {
     var result = this.Super('getEditItem', arguments);
     if (result.hasOwnProperty('valueMap') && !result.valueMap) {
       delete result.valueMap;
@@ -2312,30 +2310,31 @@
   // set some flags to prevent the picklist fields from doing extra datasource 
   // requests
   // https://issues.openbravo.com/view.php?id=16611
-  storeUpdatedEditorValue : function (suppressChange, editCol) {
+  storeUpdatedEditorValue: function (suppressChange, editCol) {
     this._storingUpdatedEditorValue = true;
     this.Super('storeUpdatedEditorValue', arguments);
     delete this._storingUpdatedEditorValue;
   },
 
   // the form gets recreated many times, maintain the already read valuemap
-  getEditorValueMap: function(field, values){
-    var editRow = this.getEditRow(), editValues = this.getEditValues(editRow);
+  getEditorValueMap: function (field, values) {
+    var editRow = this.getEditRow(),
+        editValues = this.getEditValues(editRow);
     // valuemap is set in the processcolumnvalues of the ob-view-form.js
     if (editValues && editValues[field.name + '._valueMap']) {
       return editValues[field.name + '._valueMap'];
     }
-    
+
     if (this.getEditForm() && this.getEditForm().getField(field.name)) {
       var liveField = this.getEditForm().getField(field.name);
       if (liveField.valueMap) {
         return liveField.valueMap;
       }
     }
-    
+
     return this.Super('getEditorValueMap', arguments);
   },
-  
+
   setFieldError: function (rowNum, fieldID, errorMessage, dontDisplay) {
     // if there are no errors then no need to clear
     // prevents an undefined exception because also keep errors in other 
@@ -2344,15 +2343,15 @@
       return;
     }
     return this.Super('setFieldError', arguments);
-   },
-  
-  cellHasErrors: function(rowNum, fieldID){
+  },
+
+  cellHasErrors: function (rowNum, fieldID) {
     if (this.Super('cellHasErrors', arguments)) {
       return true;
     }
     if (this.getEditRow() === rowNum) {
       var itemName = this.getEditorName(rowNum, fieldID);
-      
+
       if (this.getEditForm().hasFieldErrors(itemName)) {
         return true;
       }
@@ -2363,8 +2362,8 @@
     }
     return false;
   },
-  
-  getCellErrors: function(rowNum, fieldName){
+
+  getCellErrors: function (rowNum, fieldName) {
     var itemName;
     var ret = this.Super('getCellErrors', arguments);
     if (this.getEditRow() === rowNum) {
@@ -2372,8 +2371,8 @@
     }
     return ret;
   },
-  
-  rowHasErrors: function(rowNum, colNum){
+
+  rowHasErrors: function (rowNum, colNum) {
     if (this.Super('rowHasErrors', arguments)) {
       return true;
     }
@@ -2389,9 +2388,9 @@
     }
     return false;
   },
-  
+
   // we are being reshown, get new values for the combos
-  visibilityChanged: function(visible){
+  visibilityChanged: function (visible) {
     if (visible && this.getEditRow()) {
       this.getEditForm().doChangeFICCall();
     }
@@ -2400,11 +2399,11 @@
     }
   },
 
-  isWritable: function(record){
+  isWritable: function (record) {
     return !record._readOnly;
   },
 
-  allSelectedRecordsWritable: function() {
+  allSelectedRecordsWritable: function () {
     var i, length = this.getSelectedRecords().length;
     for (i = 0; i < length; i++) {
       var record = this.getSelectedRecords()[i];
@@ -2415,7 +2414,7 @@
     return true;
   },
 
-  setRecordErrorMessage: function(rowNum, msg){
+  setRecordErrorMessage: function (rowNum, msg) {
     var record = this.getRecord(rowNum);
     if (!record) {
       return;
@@ -2432,8 +2431,8 @@
     }
     this.refreshRow(rowNum);
   },
-  
-  setRecordFieldErrorMessages: function(rowNum, errors){
+
+  setRecordFieldErrorMessages: function (rowNum, errors) {
     var record = this.getRecord(rowNum);
     if (!record) {
       return;
@@ -2448,16 +2447,16 @@
     } else {
       record[this.recordBaseStyleProperty] = null;
     }
-    
+
     if (this.frozenBody) {
       this.frozenBody.markForRedraw();
     }
     this.body.markForRedraw();
   },
-  
+
   // overridden to handle the case that the rowNum is in fact 
   // an edit state id
-  getRecord: function(rowNum){
+  getRecord: function (rowNum) {
     if (!isc.isA.Number(rowNum)) {
       // an edit id
       rowNum = this.getEditSessionRowNum(rowNum);
@@ -2468,20 +2467,20 @@
 
   // always work with fixed rowheights
   // https://issues.openbravo.com/view.php?id=16307
-  shouldFixRowHeight: function() {
+  shouldFixRowHeight: function () {
     return true;
   },
-  
+
   // needed for: https://issues.openbravo.com/view.php?id=16307
-  getRowHeight: function() {
+  getRowHeight: function () {
     return this.cellHeight;
   },
 
   // +++++++++++++++++ functions for the edit-link column +++++++++++++++++
-  
-  createRecordComponent: function(record, colNum){
-    var fld = this.getFields()[colNum], canvas,
-      rowNum = this.getRecordIndex(record), isEditRecord = rowNum === this.getEditRow();
+  createRecordComponent: function (record, colNum) {
+    var fld = this.getFields()[colNum],
+        canvas, rowNum = this.getRecordIndex(record),
+        isEditRecord = rowNum === this.getEditRow();
     if (this.isEditLinkColumn(colNum)) {
       var layout = isc.OBGridButtonsComponent.create({
         record: record,
@@ -2494,7 +2493,13 @@
       return layout;
     }
     if (fld.clientClass && !isEditRecord) {
-      canvas = isc.ClassFactory.newInstance(fld.clientClass, {grid: this, fieldName: fld.name, rowNum: rowNum, record: record, colNum: colNum});
+      canvas = isc.ClassFactory.newInstance(fld.clientClass, {
+        grid: this,
+        fieldName: fld.name,
+        rowNum: rowNum,
+        record: record,
+        colNum: colNum
+      });
       if (canvas) {
         if (canvas.setRecord) {
           canvas.setRecord(record);
@@ -2503,9 +2508,10 @@
       }
     }
   },
-  
-  updateRecordComponent: function(record, colNum, component, recordChanged){
-    var rowNum = this.getRecordIndex(record), isEditRecord = rowNum === this.getEditRow();
+
+  updateRecordComponent: function (record, colNum, component, recordChanged) {
+    var rowNum = this.getRecordIndex(record),
+        isEditRecord = rowNum === this.getEditRow();
     if (component.editButton) {
       if (recordChanged && component.record.editColumnLayout === component) {
         component.record.editColumnLayout = null;
@@ -2527,22 +2533,22 @@
     }
     return component;
   },
-  
-  isEditLinkColumn: function(colNum){
+
+  isEditLinkColumn: function (colNum) {
     return this.editLinkColNum === colNum;
   },
 
   // This method forces a FIC call in case the user has changed the visible fields,
   // if there is a record being edited
   // This is done to load all the potentially missing combos
-  fieldStateChanged: function(){
+  fieldStateChanged: function () {
     var undef;
-    if (this.getEditRow()!==undef && this.getEditRow()!==null){
+    if (this.getEditRow() !== undef && this.getEditRow() !== null) {
       this.getEditForm().doChangeFICCall(null, true);
     }
     this.Super('fieldStateChanged', arguments);
   }
-  
+
 });
 
 // = OBGridToolStripIcon =
@@ -2550,8 +2556,9 @@
 isc.ClassFactory.defineClass('OBGridToolStripIcon', isc.ImgButton);
 
 isc.OBGridToolStripIcon.addProperties({
-  buttonType: null, /* This could be: edit - form - cancel - save */
-  initWidget: function(){
+  buttonType: null,
+  /* This could be: edit - form - cancel - save */
+  initWidget: function () {
     if (this.initWidgetStyle) {
       this.initWidgetStyle();
     }
@@ -2563,8 +2570,7 @@
 // The separator between icons of OBGridToolStrip
 isc.ClassFactory.defineClass('OBGridToolStripSeparator', isc.Img);
 
-isc.OBGridToolStripSeparator.addProperties({  
-});
+isc.OBGridToolStripSeparator.addProperties({});
 
 // = OBGridButtonsComponent =
 // The component which is used to create the contents of the
@@ -2574,23 +2580,24 @@
 isc.OBGridButtonsComponent.addProperties({
   OBGridToolStrip: null,
   saveCancelLayout: null,
-  
+
   // the grid to which this component belongs
   grid: null,
-  
+
   rowNum: null,
-  
+
   // the record to which this component belongs
   record: null,
-  
-  initWidget: function(){
-    var me = this, formButton;
-    
+
+  initWidget: function () {
+    var me = this,
+        formButton;
+
     this.editButton = isc.OBGridToolStripIcon.create({
       buttonType: 'edit',
       originalPrompt: OB.I18N.getLabel('OBUIAPP_GridEditButtonPrompt'),
       prompt: OB.I18N.getLabel('OBUIAPP_GridEditButtonPrompt'),
-      action: function(){
+      action: function () {
         var actionObject = {
           target: me,
           method: me.doEdit,
@@ -2598,31 +2605,31 @@
         };
         me.grid.view.standardWindow.doActionAfterAutoSave(actionObject, true);
       },
-      
-      setErrorMessage: function(msg){
+
+      setErrorMessage: function (msg) {
         if (msg) {
           this.prompt = msg + '<br><br>' + this.originalPrompt;
         } else {
           this.prompt = this.originalPrompt;
         }
       },
-      
-      showable: function(){
+
+      showable: function () {
         return !me.grid.view.readOnly && !me.record._readOnly;
       },
-      
-      show: function(){
+
+      show: function () {
         if (!this.showable()) {
           return;
         }
         return this.Super('show', arguments);
       }
     });
-    
+
     formButton = isc.OBGridToolStripIcon.create({
       buttonType: 'form',
       prompt: OB.I18N.getLabel('OBUIAPP_GridFormButtonPrompt'),
-      action: function(){
+      action: function () {
         var actionObject = {
           target: me,
           method: me.doOpen,
@@ -2631,49 +2638,49 @@
         me.grid.view.standardWindow.doActionAfterAutoSave(actionObject, true);
       }
     });
-    
+
     this.buttonSeparator1 = isc.OBGridToolStripSeparator.create({});
-    
+
     if (me.grid.view.readOnly) {
       this.buttonSeparator1.visibility = 'hidden';
     }
-    
+
     this.addMembers([formButton, this.buttonSeparator1, this.editButton]);
     this.Super('initWidget', arguments);
   },
-  
-  addSaveCancelProgressButtons: function() {
+
+  addSaveCancelProgressButtons: function () {
     var me = this;
     // already been here
     if (this.cancelButton) {
       return;
     }
-    
+
     this.progressIcon = isc.Img.create(this.grid.progressIconDefaults);
     this.progressIcon.setVisibility(false);
     this.addMember(this.progressIcon, 0);
-    
+
     // is referred to in OBViewForm.showClickMask
     this.cancelButton = isc.OBGridToolStripIcon.create({
       buttonType: 'cancel',
       prompt: OB.I18N.getLabel('OBUIAPP_GridCancelButtonPrompt'),
-      action: function(){
+      action: function () {
         me.doCancel();
       }
     });
-    
+
     var saveButton = isc.OBGridToolStripIcon.create({
       buttonType: 'save',
       prompt: OB.I18N.getLabel('OBUIAPP_GridSaveButtonPrompt'),
-      action: function(){
+      action: function () {
         me.doSave();
       }
     });
-    
-    this.addMembers([ this.cancelButton, isc.OBGridToolStripSeparator.create({}), saveButton]);
+
+    this.addMembers([this.cancelButton, isc.OBGridToolStripSeparator.create({}), saveButton]);
   },
-  
-  toggleProgressIcon: function(toggle){
+
+  toggleProgressIcon: function (toggle) {
     if (toggle) {
       this.hideMember(6);
       this.hideMember(5);
@@ -2690,8 +2697,8 @@
       this.showMember(offset);
     }
   },
-  
-  showEditOpen: function(){
+
+  showEditOpen: function () {
     var offset = 0;
     if (this.cancelButton) {
       this.hideMember(6);
@@ -2710,45 +2717,45 @@
     }
     this.grid.currentEditColumnLayout = null;
   },
-  
-  showSaveCancel: function(){
+
+  showSaveCancel: function () {
     this.addSaveCancelProgressButtons();
-    
+
     this.hideMember(3);
     this.hideMember(2);
     this.hideMember(1);
     this.hideMember(0);
-    
+
     this.showMember(4);
     this.showMember(5);
     this.showMember(6);
-    
+
     this.grid.currentEditColumnLayout = this;
   },
-  
-  doEdit: function(){
+
+  doEdit: function () {
     this.showSaveCancel();
     this.grid.selectSingleRecord(this.record);
     var rowNum = this.grid.getRecordIndex(this.record);
     this.grid.startEditing(rowNum);
   },
-  
-  doOpen: function(){
+
+  doOpen: function () {
     this.grid.endEditing();
     this.grid.view.editRecord(this.record);
   },
-  
-  doSave: function(){
+
+  doSave: function () {
     // note change back to editOpen is done in the editComplete event of the
     // grid itself
     this.grid.endEditing();
   },
-  
-  doCancel: function(){
+
+  doCancel: function () {
     this.grid.cancelEditing();
   },
-  
-  hideMember: function(memberNo) {
+
+  hideMember: function (memberNo) {
     if (!this.members[memberNo]) {
       return;
     }
@@ -2759,7 +2766,7 @@
     this.Super('hideMember', arguments);
   },
 
-  showMember: function(memberNo) {
+  showMember: function (memberNo) {
     if (!this.members[memberNo]) {
       return;
     }
@@ -2770,4 +2777,4 @@
     this.Super('showMember', arguments);
   }
 
-});
+});
\ No newline at end of file