Fixes issue 30222: delete popup is not hidden under some circumstances
authorInigo Sanchez <inigo.sanchez@openbravo.com>
Tue, 23 Jun 2015 10:14:39 +0200
changeset 27131 b727e3caf4c2
parent 27126 253728409491
child 27132 ff0929e96ca2
child 27136 1697e5e9cd2d
Fixes issue 30222: delete popup is not hidden under some circumstances

The problem was that if two or more records were selected and deleted, the records were deleted properly but the "Deleting..." popup is not hidden.
The user will not be able to interact with the window until he refreshes it. This happends when in a grid that contains a tree grid view

This happened when a grid contains a treegrid and this one is not open first. In that case this element "view.treeGrid.data.handleUpdate" has not been created yet.

To avoid the problem, it has added a condition that checks whether the properties have been started correctly and thus, if the properties can be accessed.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Mon Jun 22 13:51:28 2015 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Tue Jun 23 10:14:39 2015 +0200
@@ -2195,7 +2195,7 @@
                 });
               }
               view.viewGrid.data.handleUpdate('remove', recordInfos, false, req);
-              if (view.treeGrid) {
+              if (view.treeGrid && view.treeGrid.data && view.treeGrid.data.handleUpdate) {
                 view.treeGrid.data.handleUpdate('remove', recordInfos, false, req);
               }
               if (updateTotalRows) {