Fixes issue 22522: In P&E windows, lines are not removed after sorting the grid
authorAugusto Mauch <augusto.mauch@openbravo.com>
Tue, 29 Jan 2013 12:40:45 +0100
changeset 19493 4c1fdc3c495d
parent 19492 ba68df61ab6b
child 19494 f01e796f420f
Fixes issue 22522: In P&E windows, lines are not removed after sorting the grid

The correct way to retrieve the edited record corresponding with the record selection[i] is by using grid.getRecordIndex(selection[i]), and not grid.getEdited
Record(i). The previous way did not work if the grid was sorted after selecting the lines.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js	Tue Jan 29 12:16:59 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-parameter-window-view.js	Tue Jan 29 12:40:45 2013 +0100
@@ -374,14 +374,14 @@
       allProperties._allRows = [];
 
       for (i = 0; i < len; i++) {
-        tmp = isc.addProperties({}, selection[i], grid.getEditedRecord(i));
+        tmp = isc.addProperties({}, selection[i], grid.getEditedRecord(grid.getRecordIndex(selection[i])));
         allProperties._selection.push(tmp);
       }
 
       len = (allRows && allRows.length) || 0;
 
       for (i = 0; i < len; i++) {
-        tmp = isc.addProperties({}, allRows[i], grid.getEditedRecord(i));
+        tmp = isc.addProperties({}, allRows[i], grid.getEditedRecord(grid.getRecordIndex(allRows[i])));
         allProperties._allRows.push(tmp);
       }
     }