fixed bug 24686: grid config not saved if the only config is different sorting
authorAsier Lostalé <asier.lostale@openbravo.com>
Wed, 04 Sep 2013 12:26:15 +0200
changeset 21069 4e3c9792779c
parent 21068 df680df14807
child 21070 48a572198722
fixed bug 24686: grid config not saved if the only config is different sorting
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-view-grid.js	Wed Sep 04 11:43:03 2013 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Wed Sep 04 12:26:15 2013 +0200
@@ -1249,12 +1249,19 @@
       this.view.standardWindow.doActionAfterAutoSave(actionObject, true);
       return;
     }
-    var field = this.fields[fieldNum];
+    var field = this.fields[fieldNum],
+        res;
     if (this.isCheckboxField(field) && this.singleRecordSelection) {
       this.deselectAllRecords();
       this.singleRecordSelection = false;
     }
-    return this.Super('headerClick', arguments);
+    res = this.Super('headerClick', arguments);
+
+    if (field.canSort !== false) {
+      // saving grid configuration after sorting by new a field
+      this.view.standardWindow.storeViewState();
+    }
+    return res;
   },
 
   keyPress: function () {