Fixes Issue 22797: Pick and Execute in Payment Proposal window is not working properly
authorShankar Balachandran <shankar.balachandran@openbravo.com>
Thu, 13 Mar 2014 11:43:10 +0530
changeset 22696 a9321acaca4e
parent 22694 e74230fb5c88
child 22697 6e9494ef95ff
Fixes Issue 22797: Pick and Execute in Payment Proposal window is not working 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	Wed Mar 12 20:26:41 2014 -0300
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Thu Mar 13 11:43:10 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]);
         }
       }
     }