Fixes issue 25935: JS Error when opening TreeGrid selector
authorAugusto Mauch <augusto.mauch@openbravo.com>
Thu, 13 Mar 2014 15:32:33 +0100
changeset 22705 15994dc74cd8
parent 22704 2ac8f9165769
child 22706 f8fcc834d0c1
Fixes issue 25935: JS Error when opening TreeGrid selector

A function was being executed on the tree grid data before it was properly initialized.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-grid.js	Thu Mar 13 13:47:53 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-grid.js	Thu Mar 13 15:32:33 2014 +0100
@@ -129,7 +129,10 @@
   },
 
   handleFilterEditorSubmit: function (criteria, context, callback) {
-    this.setOpenState('[]');
+    if (isc.isA.Tree(this.data)) {
+      // Only reset the open state if the tree already has data
+      this.setOpenState('[]');
+    }
     this.Super('handleFilterEditorSubmit', arguments);
   },