Fixes issue 25475: Pick and Execute in Payment Proposal window is not filtering properly
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Thu, 13 Mar 2014 12:02:15 +0530
changeset 22698 b1b07d0d1e14
parent 22697 6e9494ef95ff
child 22699 6eec2bc4a068
Fixes issue 25475: Pick and Execute in Payment Proposal window is not filtering properly

In case of large data, if data is not available in allRows, it is checked if localData contains data.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Thu Mar 13 11:57:47 2014 +0530
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Thu Mar 13 12:02:15 2014 +0530
@@ -343,7 +343,7 @@
   },
 
   dataArrived: function (startRow, endRow) {
-    var record, i, allRows, selectedLen = this.selectedIds.length,
+    var record, i, rows, selectedLen = this.selectedIds.length,
         len, savedRecord, index, j, fields;
     fields = this.getFields();
     for (i = 0; i < selectedLen; i++) {
@@ -372,11 +372,11 @@
 
     if (selectedLen === 0) {
       // push all *selected* rows into selectedIds cache
-      allRows = this.data.allRows || [];
-      len = allRows.length;
+      rows = this.data.allRows || this.data.localData || [];
+      len = rows.length;
       for (i = 0; i < len; i++) {
-        if (allRows[i][this.selectionProperty]) {
-          this.selectedIds.push(allRows[i][OB.Constants.ID]);
+        if (rows[i] && rows[i][this.selectionProperty]) {
+          this.selectedIds.push(rows[i][OB.Constants.ID]);
         }
       }
     }