fixes issue 38555: JS Error after opening a window under some circumstances
authorCarlos Aristu <carlos.aristu@openbravo.com>
Wed, 16 May 2018 08:54:42 +0200
changeset 33963 e8f606ccb519
parent 33962 3470c011cf77
child 33964 46253db4f9d3
fixes issue 38555: JS Error after opening a window under some circumstances

When opening a window having the lazy filtering enabled, the funnel icon is hidden automatically. But when opening a window with some particular configuration it is possible to reach the code that hides the funnel icon without having it initialized yet. In this case a JS error was thrown avoiding the correct loading of the window.

To fix the problem we just check whether the funnel icon has been initialized before trying to hide it.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Tue May 15 18:32:09 2018 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Wed May 16 08:54:42 2018 +0200
@@ -832,7 +832,9 @@
       if (this.sorter) {
         this.filterHasChanged = true;
         this.sorter.enable();
-        this.filterImage.hide();
+        if (this.filterImage) {
+          this.filterImage.hide();
+        }
       }
     }
     if (!keepFilterClause) {