Fixed issue 28857:Minimized view of query-list widgets sort data in the client
authorInigo Sanchez <inigo.sanchez@openbravo.com>
Wed, 25 Feb 2015 01:00:06 +0100
changeset 26073 9b61d12d4904
parent 26072 694b64ebdb05
child 26074 92405876894e
Fixed issue 28857:Minimized view of query-list widgets sort data in the client

The problem was that in minimized view, the query-list widgets just sort the data
in the client. So it is only showing the data being displayed locally, instead of
requesting the data to the server.

This happens because "useClientSorting" was not setting properly. This is related
to the change of leaving of calculate total rows to improve performance.

Now, it works properly in minimized and maximized view because it has been setting
properly "useClientSorting" variable. The exceptional case is when the widget is in
minimized view and "ShowAllData" is not active. In this case, it will always make a
request for the data.
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-widget.js	Tue Feb 24 22:09:13 2015 +0000
+++ b/modules/org.openbravo.client.querylist/web/org.openbravo.client.querylist/js/ob-querylist-widget.js	Wed Feb 25 01:00:06 2015 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -131,6 +131,12 @@
     if (this.viewMode === 'widget') {
       this.setWidgetHeight();
     }
+    if (this.viewMode === 'maximized') {
+      this.grid.data.useClientSorting = true;
+    } else {
+      // reload data in grid when not show all records
+      this.grid.data.useClientSorting = this.parameters.showAll ? true : false;
+    }
     // sometimes when removing the form, this gets called
     // at that point this.grid is not set anymore
     if (this.grid) {