[OBCQL] Fixed menu items and refresh on Maximized view.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 30 Dec 2010 17:42:13 +0100
changeset 9501 15f23ade6a08
parent 9500 10c07f84553f
child 9502 fe2d742aaf33
[OBCQL] Fixed menu items and refresh on Maximized view.
modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-view.js
modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js
--- a/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-view.js	Thu Dec 30 17:41:17 2010 +0100
+++ b/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-view.js	Thu Dec 30 17:42:13 2010 +0100
@@ -26,6 +26,7 @@
   widgetInstanceId: null,
   fields: null,
   gridDataSource: null,
+  widgetId: null,
 
   //Set PortalLayout common parameters
   numColumns: 1,
@@ -38,14 +39,20 @@
     this.widgetInstanceId = args.widgetInstanceId;
     this.fields = args.fields;
     this.gridDataSource = args.gridDataSource;
+    this.widgetId = args.widgetId;
 
-    var widgetInstance = isc.OBQueryListWidget.create(isc.addProperties({
+    var widgetInstance = isc['_'+this.widgetId].create(isc.addProperties({
         viewMode: 'maximized',
         fields: this.fields,
         widgetInstanceId: this.widgetInstanceId,
+        widgetId: this.widgetId,
         dbInstanceId: this.widgetInstanceId,
         gridDataSource: this.gridDataSource,
-        title: args.tabTitle
+        title: args.tabTitle,
+        menuItems: args.menuItems,
+        parameters: args.parameters,
+        fieldDefinitions: args.fieldDefinitions,
+        canDelete: false
       }));
     this.addPortlet(widgetInstance);
   },
--- a/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js	Thu Dec 30 17:41:17 2010 +0100
+++ b/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js	Thu Dec 30 17:42:13 2010 +0100
@@ -86,7 +86,9 @@
   },
   
   refresh: function(){
-    this.setWidgetHeight();
+    if (this.viewMode === 'widget') {
+      this.setWidgetHeight();
+    }
     this.grid.invalidateCache();
     this.grid.filterData();
   },
@@ -112,8 +114,12 @@
     OB.Layout.ViewManager.openView('OBQueryListView',  {
       tabTitle: this.title,
       widgetInstanceId: this.dbInstanceId,
+      widgetId: this.widgetId,
       fields: this.maximizedFields,
-      gridDataSource: this.gridDataSource
+      gridDataSource: this.gridDataSource,
+      parameters: this.parameters,
+      menuItems: this.menuItems,
+      fieldDefinitions: this.fieldDefinitions
     });
   }