Fixes issue 26036: Tree grid and standard grid show the same fields
authorAugusto Mauch <augusto.mauch@openbravo.com>
Thu, 20 Mar 2014 13:30:01 +0100
changeset 22735 bebe124e664d
parent 22734 a4bac660abf1
child 22736 01cb4d10ffc3
Fixes issue 26036: Tree grid and standard grid show the same fields

Every time the tree grid is shown, its fields are set from the standard grid fields. This way, both views display always the same fields.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Thu Mar 20 11:21:11 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js	Thu Mar 20 13:30:01 2014 +0100
@@ -1731,6 +1731,8 @@
     treeGrid.hide();
     view.isShowingTree = false;
   } else {
+    // Copy the viewGrid fields to the treeGrid, so that both views always display the same fields
+    treeGrid.setFields(treeGrid.getTreeGridFields(viewGrid.getFields()));
     treeGrid.copyCriteriaFromViewGrid();
     treeGrid.setData([]); // forcing refresh
     treeGrid.fetchData(treeGrid.getCriteria());