details:   https://code.openbravo.com/erp/devel/pi/rev/a569477afae5
changeset: 20480:a569477afae5
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Tue May 28 12:46:06 2013 +0200
summary:   Fixes issue 23889: No extra datasource calls are done by selectors

Pick lists and grids use a property called drawAllMaxCells, that is used to 
determine how many cells should be fetched from the datasource, its default 
value is 250. If after making a datasource call smartclient finds out that the 
number of retrieved cells is lower than drawAllMaxCells, it will do another 
datasource call, and repeat this process until the number of cells fetched are 
higher than drawAllMaxCells or until all cells have been fetched.

This is not the intented behaviour, we want the rows to be fetched when the 
user scrolls down and is out of cached rows. That is why in the definition of 
OBViewGrid the drawAllMaxCells is set to 0. To fix this issue this property is 
also set to 0 in the selector pick list and grid.

diffstat:

 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
 |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r 4b94b5a758f8 -r a569477afae5 
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
--- 
a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Tue May 28 14:13:20 2013 +0530
+++ 
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
      Tue May 28 12:46:06 2013 +0200
@@ -78,6 +78,10 @@
       selector: this.selector,
       selectionAppearance: this.selectionAppearance,
 
+      // drawAllMaxCells is set to 0 to prevent extra reads of data
+      // Smartclient will try to read until drawAllMaxCells has been reached
+      drawAllMaxCells: 0,
+
       dataProperties: {
         useClientFiltering: false,
         useClientSorting: false
@@ -458,6 +462,9 @@
 
   setUpPickList: function (show, queueFetches, request) {
     this.pickListProperties.canResizeFields = true;
+    // drawAllMaxCells is set to 0 to prevent extra reads of data
+    // Smartclient will try to read until drawAllMaxCells has been reached
+    this.pickListProperties.drawAllMaxCells = 0;
     // Set the pickListWidth just before being shown.
     this.setPickListWidth();
     this.Super('setUpPickList', arguments);

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to