← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15288: tei grid, show/hide columns and additional column for orgunit

 

------------------------------------------------------------
revno: 15288
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Fri 2014-05-16 13:32:21 +0200
message:
  tei grid, show/hide columns and additional column for orgunit
added:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/column-modal.html
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/registration.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html


--
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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json	2014-05-15 17:16:31 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json	2014-05-16 11:32:21 +0000
@@ -56,6 +56,8 @@
     "data_element": "Data element",
     "value": "Value",
     "provided_elsewhere": "Provided elsewhere",
+    "show_hide_columns": "Show/Hide columns",
+    "select_columns_to_show": "Select columns to show",
     "show_hide_widgets": "Show/Hide widgets",
     "select_widgets_to_show": "Select widgets to show",
     "close": "Close",
@@ -76,6 +78,7 @@
     "save_and_continue": "Save and continue",
     "go_back": "Go back",
     "more": "More",
+    "advanced_search": "Advanced search",
     "profile": "Profile",
     "applications": "Apps",
     "more_applications": "More apps",

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html	2014-05-14 13:04:39 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html	2014-05-16 11:32:21 +0000
@@ -73,7 +73,7 @@
         <link type="text/css" rel="stylesheet" media="screen,print" href="../dhis-web-commons/css/widgets.css"/>
         <link type="text/css" rel="stylesheet" media="screen" href="../dhis-web-commons/css/menu.css">
         
-        <link type="text/css" rel="stylesheet" href="styles/style.css">                
+        <link type="text/css" rel="stylesheet" href="styles/style.css">           
        
     </head>
     <body>

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-05-15 17:16:31 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-05-16 11:32:21 +0000
@@ -8,6 +8,7 @@
         function($rootScope,
                 $scope,
                 $location,
+                $modal,
                 Paginator,
                 TranslationService, 
                 SelectedEntity,
@@ -111,8 +112,7 @@
         $scope.emptySearchText = false;
         $scope.emptySearchAttribute = false;
         $scope.showSearchDiv = false;
-        $scope.showRegistrationDiv = false;                
-        $scope.gridColumns = $scope.attributes;     
+        $scope.showRegistrationDiv = false;                          
         $scope.trackedEntityList = null; 
         
         var queryUrl = null, 
@@ -123,15 +123,32 @@
             programUrl = 'program=' + $scope.selectedProgram.id;
         }      
 
-        //generate grid column for the selected program
+        $scope.gridColumns = $scope.attributes;   
+        //also add extra columns - orgunit for example
+        $scope.gridColumns.push({id: 'orgUnitName', name: 'Organisation unit', type: 'string'});
+        
+        //generate grid column for the selected program/attributes
         angular.forEach($scope.gridColumns, function(gridColumn){
+            
+            if(gridColumn.id === 'orgUnitName' && $scope.ouMode === 'SELECTED'){
+                gridColumn.show = false;    
+            }
+            else{
+                gridColumn.show = true;
+            }
+            
             gridColumn.showFilter =  false;
-            gridColumn.hide = false;                   
+            
             if(gridColumn.type === 'date'){
                  $scope.filterText[gridColumn.id]= {start: '', end: ''};
             }
         });
         
+        
+        
+        
+        console.log('the columns are:  ', $scope.gridColumns);
+        
         if( mode === $scope.searchMode.freeText ){     
             if(!$scope.searchText){                
                 $scope.emptySearchText = true;
@@ -151,7 +168,7 @@
                 return;
             }
         }
-       else if( mode === $scope.searchMode.listAll ){   
+        else if( mode === $scope.searchMode.listAll ){   
             $scope.showTrackedEntityDiv = true;    
         }      
 
@@ -162,6 +179,8 @@
                                             programUrl,
                                             attributeUrl.url).then(function(data){
             $scope.trackedEntityList = data;
+            
+            console.log('the list is:  ', $scope.trackedEntityList);
         });
     };
     
@@ -216,7 +235,36 @@
                 $scope.gridColumns[i].showFilter = false;
             }
         }
-    };    
+    };   
+    
+    $scope.showHideColumns = function(){
+        
+        $scope.hiddenGridColumns = 0;
+        
+        angular.forEach($scope.gColumns, function(gridColumn){
+            if(!gridColumn.show){
+                $scope.hiddenGridColumns++;
+            }
+        });
+        
+        var modalInstance = $modal.open({
+            templateUrl: 'views/column-modal.html',
+            controller: 'ColumnDisplayController',
+            resolve: {
+                gridColumns: function () {
+                    return $scope.gridColumns;
+                },
+                hiddenGridColumns: function(){
+                    return $scope.hiddenGridColumns;
+                }
+            }
+        });
+
+        modalInstance.result.then(function (gridColumns) {
+            $scope.gridColumns = gridColumns;
+        }, function () {
+        });
+    };
     
     $scope.showDashboard = function(currentEntity){       
         SelectedEntity.setSelectedEntity(currentEntity);
@@ -229,6 +277,31 @@
     };    
 })
 
+//Controller for column show/hide
+.controller('ColumnDisplayController', 
+    function($scope, 
+            $modalInstance, 
+            hiddenGridColumns,
+            gridColumns){
+    
+    $scope.gridColumns = gridColumns;
+    $scope.hiddenGridColumns = hiddenGridColumns;
+    
+    $scope.close = function () {
+      $modalInstance.close($scope.gridColumns);
+    };
+    
+    $scope.showHideColumns = function(gridColumn){
+       
+        if(gridColumn.show){                
+            $scope.hiddenGridColumns--;            
+        }
+        else{
+            $scope.hiddenGridColumns++;            
+        }      
+    };    
+})
+
 .controller('RegistrationController', 
         function($scope,
                 AttributesFactory,

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2014-05-15 17:16:31 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2014-05-16 11:32:21 +0000
@@ -152,7 +152,7 @@
 })
 
 /* Service for getting tracked entity instances */
-.factory('TrackedEntityInstanceService', function($http, $filter) {
+.factory('TrackedEntityInstanceService', function($http, $filter, EntityService) {
     
     var promise;
     return {
@@ -180,7 +180,7 @@
             var url = '../api/trackedEntityInstances.json?ou=' + orgUnitUid + '&program=' + programUid;
             
             promise = $http.get( url ).then(function(response){               
-                return entityFormatter(response.data);
+                return EntityService.formatter(response.data);
             });            
             return promise;
         },
@@ -189,7 +189,7 @@
             var url =  '../api/trackedEntityInstances.json?ou=' + orgUnitUid;
             
             promise = $http.get( url ).then(function(response){                                
-                return entityFormatter(response.data);
+                return EntityService.formatter(response.data);
             });            
             return promise;
         },        
@@ -208,7 +208,7 @@
             }
             
             promise = $http.get( url ).then(function(response){                                
-                return entityFormatter(response.data);
+                return EntityService.formatter(response.data);
             });            
             return promise;
         }
@@ -392,15 +392,7 @@
                         query.url = 'filter=' + attribute.id + ':LIKE:' + attribute.value;
                     }
                 }
-            }
-            /*else{
-                if(query.url){
-                    query.url = query.url + '&filter=' + attribute.id;
-                }
-                else{
-                    query.url = 'filter=' + attribute.id;
-                }
-            }*/
+            }            
         });
         return query;
     };    
@@ -623,10 +615,59 @@
         }
     };
             
+})
+
+.service('EntityService', function(OrgUnitService){
+    
+    return {
+        formatter: function(grid){
+            if(!grid || !grid.rows){
+                return;
+            }
+            
+            //grid.headers[0-4] = Instance, Created, Last updated, Org unit, Tracked entity
+            //grid.headers[5..] = Attribute, Attribute,.... 
+            var attributes = [];
+            for(var i=5; i<grid.headers.length; i++){
+                attributes.push({id: grid.headers[i].name, name: grid.headers[i].column});
+            }
+
+            var entityList = [];
+
+            OrgUnitService.open().then(function(){
+
+                angular.forEach(grid.rows, function(row){
+                    var entity = {};
+                    var isEmpty = true;
+
+                    entity.id = row[0];
+                    entity.orgUnit = row[3];                              
+                    entity.type = row[4];  
+
+                    OrgUnitService.get(row[3]).then(function(ou){
+                        if(ou){
+                            entity.orgUnitName = ou.n;
+                        }                                                       
+                    });
+
+                    for(var i=5; i<row.length; i++){
+                        if(row[i] && row[i] !== ''){
+                            isEmpty = false;
+                            entity[grid.headers[i].name] = row[i];
+                        }
+                    }
+
+                    if(!isEmpty){
+                        entityList.push(entity);
+                    }        
+                });                
+            });
+            return {headers: attributes, rows: entityList};                                    
+        }
+    };
 });
 
 
-
 /*
 * Helper functions
 */
@@ -647,20 +688,34 @@
     
     var entityList = [];
     
-    angular.forEach(grid.rows, function(row){
-        var entity = {};
-        
-        entity.id = row[0];
-        entity.orgUnit = row[3];
-        entity.type = row[4];        
-        
-        for(var i=5; i<row.length; i++){
-            entity[grid.headers[i].name] = row[i];            
-        }
-        
-        entityList.push(entity);        
-        
-    });
-    
-    return {headers: attributes, rows: entityList};
+    OrgUnitService.open().then(function(){
+        
+        angular.forEach(grid.rows, function(row){
+            var entity = {};
+            var isEmpty = true;
+
+            entity.id = row[0];
+            entity.orgUnit = row[3];
+            entity[row[3]] = row[3]; //this is orgunit.           
+            entity.type = row[4];  
+            
+            OrgUnitService.get(row[3]).then(function(ou){
+                if(ou){
+                    entity[row[3]] = ou.n;
+                }                                                       
+            });
+
+            for(var i=5; i<row.length; i++){
+                if(row[i] && row[i] !== ''){
+                    isEmpty = false;
+                    entity[grid.headers[i].name] = row[i];
+                }
+            }
+
+            if(!isEmpty){
+                entityList.push(entity);
+            }        
+        });          
+        return {headers: attributes, rows: entityList};                                    
+    });    
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2014-05-15 17:16:31 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2014-05-16 11:32:21 +0000
@@ -435,8 +435,10 @@
     width: 100%;
     border-collapse: collapse;
     cursor: pointer;
+    table-layout: fixed;
 }
 
+
 .dhis2-table-striped-border tr th {
     border: 1px solid #cad5e5;
 }

=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/column-modal.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/column-modal.html	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/column-modal.html	2014-05-16 11:32:21 +0000
@@ -0,0 +1,18 @@
+<div class="modal-header page">
+    <h3>{{'select_columns_to_show'| translate}}</h3>
+</div>
+<div class="modal-body page">   
+    <table class="listTable dhis2-table-striped-border">
+        <tr ng-repeat="gridColumn in gridColumns">
+            <td>
+                {{gridColumn.name}}
+            </td>
+            <td>
+                <input type="checkbox" ng-model="gridColumn.show" ng-change="showHideColumns(gridColumn)" ng-disabled="hiddenGridColumns + 1 == gridColumns.length && gridColumn.show">
+            </td>
+        </tr>                                    
+    </table>    
+</div>
+<div class="modal-footer page">        
+    <button class="btn btn-default" data-ng-click="close()">{{'close'| translate}}</button>
+</div> 
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html	2014-05-15 17:16:31 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html	2014-05-16 11:32:21 +0000
@@ -24,19 +24,20 @@
         <div class="input-group col-md-6">
             <input type="text" placeholder="{{'your_search_input_here'| translate}}" ng-model="searchText" class="form-control" ng-class="{true: 'invalid - input'} [!searchText && emptySearchText]" ng-focus="hideSearch()" ng-disabled="showRegistrationDiv">
             <span class="input-group-btn">
-                <button class="btn btn-default" type="button" title="{{'more'| translate}}" ng-click="showSearch()" ng-disabled="showRegistrationDiv"><i class="fa fa-cog"></i></button>
+                <button class="btn btn-default" type="button" title="{{'advanced_search'| translate}}" ng-click="showSearch()" ng-disabled="showRegistrationDiv"><i class="fa fa-cog"></i></button>
             </span>                
         </div>        
         <div class="col-md-6">
             <div class="btn-group">
                 <button type="button" 
                         class="btn btn-default"
-                        ng-disabled="showRegistrationDiv"
+                        ng-disabled="showRegistrationDiv || showSearchDiv"
                         ng-click="search(searchMode.freeText)">
                     {{'search'| translate}}
                 </button>
                 <button type="button" 
-                        class="btn btn-default" 
+                        class="btn btn-default"
+                        ng-disabled="showSearchDiv"
                         ng-click="search(searchMode.listAll)">
                     {{'list_all'| translate}}
                 </button>
@@ -65,7 +66,7 @@
     </div>
 
     <!-- search begins -->
-    <div class="row" ng-if="showSearchDiv">
+    <div class="row" ng-show="showSearchDiv">
         <div class="col-md-6">
             <div ng-include="'views/search.html'"></div>             
         </div>
@@ -75,7 +76,7 @@
     <!--registration begins -->
     <div class="row" ng-if="showRegistrationDiv">
         <div class="col-md-6">
-            <div ng-include="'views/registration.html'" ng-controller='RegistrationController'></div>             
+            <div ng-include="'views/registration.html'"></div>             
         </div>
     </div>
     <!-- registration ends -->

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/registration.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/registration.html	2014-05-14 13:04:39 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/registration.html	2014-05-16 11:32:21 +0000
@@ -1,5 +1,5 @@
 <div class="bordered-div col-md-12">
-    <h2>
+    <h2>        
         <span ng-show="!selectedProgram">
             {{'add_new'| translate}} {{selectedProgram.trackedEntity.name}}
         </span>

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html	2014-05-15 17:16:31 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html	2014-05-16 11:32:21 +0000
@@ -3,24 +3,13 @@
     <div class="search-container">
         <table class="dhis2-list-table-striped dhis2-table-hover">
             <tr>
-                <td>{{'org_unit_mode'| translate}}</td>
+                <td>{{'org_unit_mode'| translate}} - {{ouMode}}</td>
                 <td>
-                    <input type='radio' ng-model='ouMode' value='SELECTED'>{{'use_selected'| translate}}<br/>
-                    <input type='radio' ng-model='ouMode' value='CHILDREN'>{{'use_immediate_children'| translate}}<br/>
-                    <input type='radio' ng-model='ouMode' value='DESCENDANTS'>{{'use_all_children'| translate}}
+                    <input type="radio" ng-model="ouMode" value="SELECTED">{{'use_selected'| translate}}<br/>
+                    <input type="radio" ng-model="ouMode" value="CHILDREN">{{'use_immediate_children'| translate}}<br/>
+                    <input type="radio" ng-model="ouMode" value="DESCENDANTS">{{'use_all_children'| translate}}
                 </td>
             </tr>
-            <!--<tr>
-                <td>
-                    {{'program'| translate}}
-                </td>
-                <td>
-                    <select class="form-control" ng-model="pr" ng-change="getProgramAttributes(pr)" ng-options="program as program.name for program in programs | orderBy: 'name'">
-                        <option value="">{{'please_select'| translate}}</option>
-                    </select>
-                </td>
-            </tr>     --> 
-
             <tr ng-repeat="attribute in attributes">
                 <td>
                     {{attribute.name}} - {{attribute.valueType}}
@@ -54,13 +43,7 @@
                 </td>
             </tr>         
         </table>
-    </div>
-
-    <div class="row" ng-if="emptySearchAttribute">
-        <div class="col-md-6">
-            <div class="alert alert-danger">{{'search_input_required'| translate}}</div>         
-        </div>
-    </div>
+    </div>   
 
     <div class="btn-group">
         <button type="button" 
@@ -70,9 +53,19 @@
         </button>
         <button type="button" 
                 class="btn btn-default" 
+                ng-click="search(searchMode.listAll)">
+            {{'list_all'| translate}}
+        </button>
+        <button type="button" 
+                class="btn btn-default" 
                 ng-click="closeSearch()">
             {{'cancel'| translate}}
         </button>        
     </div>
+    <div class="row" ng-if="emptySearchAttribute">
+        <div class="col-md-12">
+            <div class="alert alert-danger">{{'search_input_required'| translate}}</div>         
+        </div>
+    </div>
 
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html	2014-05-14 13:09:15 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html	2014-05-16 11:32:21 +0000
@@ -3,8 +3,13 @@
     <div ng-switch-default>
         <h2>
             {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}
+            <span class="pull-right">
+                <button class="btn btn-default" ng-click="showHideColumns()">
+                    {{'show_hide_columns'| translate}}
+                </button>
+            </span>
         </h2>
-        <div ng-switch="trackedEntityList.rows.length">
+        <div class="vertical-spacing" ng-switch="trackedEntityList.rows.length">
             <div ng-switch-when="undefined">
                 <p>
                     {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}                        
@@ -21,7 +26,7 @@
                 <table class="listTable dhis2-table-striped-border dhis2-table-hover">                    
                     <thead>                        
                         <tr>
-                            <th ng-show="!gridColumn.hide" 
+                            <th ng-show="gridColumn.show" 
                                 class="max-column-width"                                                
                                 ng-repeat="gridColumn in gridColumns">
 
@@ -45,29 +50,29 @@
                                 <!-- filter icon ends -->
 
                                 <!-- filter input field begins -->
-                    <div ng-show="gridColumn.showFilter">
-                        <span ng-show="gridColumn.type !== 'date'">
-                            <input type="text" ng-model="filterText[gridColumn.id]" ng-blur="filterInGrid(gridColumn)">
-                        </span>                                                    
-                        <span ng-show="gridColumn.type === 'date'">
-                            <input placeholder="{{'start_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].start" data-ng-date readonly="readonly">
-                            <span ng-hide="filterText[gridColumn.id].start == 'undefined' || filterText[gridColumn.id].start == ''">
-                                <a href ng-click='removeStartFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
-                            </span>
-                            <input placeholder="{{'end_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].end" data-ng-date readonly="readonly">
-                            <span ng-hide="filterText[gridColumn.id].end == 'undefined' || filterText[gridColumn.id].end == ''">
-                                <a href ng-click='removeEndFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
-                            </span>
-                        </span>
-                    </div>
-                    <!-- filter input field ends -->
-                    </th>                                    
-                    </tr>                        
+                                <div ng-show="gridColumn.showFilter">
+                                    <span ng-show="gridColumn.type !== 'date'">
+                                        <input type="text" ng-model="filterText[gridColumn.id]" ng-blur="filterInGrid(gridColumn)">
+                                    </span>                                                    
+                                    <span ng-show="gridColumn.type === 'date'">
+                                        <input placeholder="{{'start_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].start" data-ng-date readonly="readonly">
+                                        <span ng-hide="filterText[gridColumn.id].start == 'undefined' || filterText[gridColumn.id].start == ''">
+                                            <a href ng-click='removeStartFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
+                                        </span>
+                                        <input placeholder="{{'end_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].end" data-ng-date readonly="readonly">
+                                        <span ng-hide="filterText[gridColumn.id].end == 'undefined' || filterText[gridColumn.id].end == ''">
+                                            <a href ng-click='removeEndFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
+                                        </span>
+                                    </span>
+                                </div>
+                                <!-- filter input field ends -->
+                            </th>                                    
+                        </tr>                        
                     </thead>
                     <tbody id="list">
                         <tr ng-repeat="trackedEntity in trackedEntityList.rows| paginate:rowsPerPage | orderBy:sortHeader:reverse | gridFilter:filterText:currentFilter" 
                             ng-click="showDashboard(trackedEntity)">
-                            <td class="max-column-width"                                              
+                            <td class="max-column-width" ng-show="gridColumn.show"                                            
                                 ng-repeat="gridColumn in gridColumns">                                                
                                 {{trackedEntity[gridColumn.id]}}                                                
                             </td>