Fixes Issue 0024692: Double request to the datasource is done when a numeric field is in the first position of the grid
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Tue, 24 Sep 2013 13:08:10 +0530
changeset 21185 2bbac483aff8
parent 21184 aeaf485ca874
child 21186 92740d37c7e2
Fixes Issue 0024692: Double request to the datasource is done when a numeric field is in the first position of the grid

In numeric fields, then in the blur event, the filters are applied again if its not applied through performGridAction.
But this was resulting in double datasource calls, if the numeric field is the first field of the grid.
Added validation to performGridAction only if the numeric field is not the first field of the grid.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js	Mon Sep 23 13:03:59 2013 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-number.js	Tue Sep 24 13:08:10 2013 +0530
@@ -593,7 +593,9 @@
 
   // If the filter has not been applied yet, apply it when it loses the focus
   blur: function () {
-    this.form.grid.performAction();
+    if (this.form && this.form.getFocusItem() !== this) {
+      this.form.grid.performAction();
+    }
     return this.Super('blur', arguments);
   },