← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21294: tracker-capture: reset tei list grid columns everytime a search is made

 

------------------------------------------------------------
revno: 21294
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-12-03 15:00:43 +0100
message:
  tracker-capture: reset tei list grid columns everytime a search is made
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-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-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2015-12-02 16:59:35 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2015-12-03 14:00:43 +0000
@@ -169,10 +169,7 @@
     $scope.processAttributes = function(){
         $scope.sortColumn = {};
         AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){
-            $scope.attributes = AttributesFactory.generateAttributeFilters(atts);
-            var grid = TEIGridService.generateGridColumns($scope.attributes, $scope.selectedOuMode.name);
-            $scope.gridColumns = grid.columns;
-            
+            $scope.attributes = AttributesFactory.generateAttributeFilters(atts);            
             if($scope.showRegistrationDiv){
                 $scope.doSearch = false;
             }
@@ -208,6 +205,9 @@
    
     //$scope.searchParam = {bools: []};
     $scope.search = function(mode){        
+        var grid = TEIGridService.generateGridColumns($scope.attributes, $scope.selectedOuMode.name);
+        $scope.gridColumns = grid.columns;
+            
         $scope.selectedSearchMode = mode;
         $scope.emptySearchText = false;
         $scope.emptySearchAttribute = false;