← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20227: event-capture: when event edit is canceled make sure changes are also canceled from grid view

 

------------------------------------------------------------
revno: 20227
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-18 12:31:11 +0200
message:
  event-capture: when event edit is canceled make sure changes are also canceled from grid view
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-09-17 11:21:04 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2015-09-18 10:31:11 +0000
@@ -420,7 +420,13 @@
                 bodyText: 'unsaved_data_exists_proceed'
             };
 
-            ModalService.showModal({}, modalOptions).then(function(result){            
+            ModalService.showModal({}, modalOptions).then(function(result){
+                for(var i=0; i<$scope.dhis2Events.length; i++){
+                    if($scope.dhis2Events[i].event === $scope.currentEvent.event){
+                        $scope.dhis2Events[i] = $scope.currentEventOriginialValue;                        
+                        break;
+                    }
+                }                
                 $scope.showEventList();
             });
         }