[Tree Extension] Link toolbar button works properly in tree grid views
authorAugusto Mauch <augusto.mauch@openbravo.com>
Thu, 20 Feb 2014 18:42:56 +0100
changeset 22527 c9de7eb81bcd
parent 22526 9d652e0aa1f3
child 22528 be91518557c4
[Tree Extension] Link toolbar button works properly in tree grid views
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Thu Feb 20 18:28:27 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Thu Feb 20 18:42:56 2014 +0100
@@ -612,8 +612,10 @@
     url = url + '?tabId=' + this.tabId;
     if (this.isShowingForm && this.viewForm.isNew && this.isRootView) {
       url = url + '&command=NEW';
-    } else if ((this.isShowingForm || !this.isRootView) && this.viewGrid.getSelectedRecords() && this.viewGrid.getSelectedRecords().length === 1) {
+    } else if ((this.isShowingForm || !this.isRootView) && !this.isShowingTree && this.viewGrid.getSelectedRecords() && this.viewGrid.getSelectedRecords().length === 1) {
       url = url + '&recordId=' + this.viewGrid.getSelectedRecord().id;
+    } else if ((this.isShowingForm || !this.isRootView) && this.isShowingTree && this.treeGrid.getSelectedRecords() && this.treeGrid.getSelectedRecords().length === 1) {
+      url = url + '&recordId=' + this.treeGrid.getSelectedRecord().id;
     } else if (!this.isShowingForm && this.isRootView) {
       crit = this.viewGrid.getCriteria();
       if (crit && crit.criteria && crit.criteria.length > 0) {