dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #42438
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21703: Fixed paging in tracker capture program dashboard
------------------------------------------------------------
revno: 21703
committer: Markus Bekken <markus.bekken@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2016-01-12 14:12:43 +0100
message:
Fixed paging in tracker capture program dashboard
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 2016-01-07 10:54:44 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2016-01-12 13:12:43 +0000
@@ -57,7 +57,7 @@
$scope.attributesById = null;
$scope.doSearch = true;
- function resetParams(){
+ function resetParams(goToPage){
$scope.trackedEntityList = null;
$scope.sortColumn = {};
$scope.emptySearchText = false;
@@ -68,7 +68,10 @@
$scope.queryUrl = null;
$scope.programUrl = null;
$scope.attributeUrl = {url: null, hasValue: false};
- $scope.pager = {pageSize: 50, page: 1, toolBarDisplay: 5};
+ if(!goToPage){
+ $scope.pager = {pageSize: 50, page: 1, toolBarDisplay: 5};
+ }
+
}
//watch for selection of org unit from tree
@@ -229,8 +232,8 @@
};
//$scope.searchParam = {bools: []};
- $scope.search = function(mode){
- resetParams();
+ $scope.search = function(mode,goToPage){
+ resetParams(goToPage);
var grid = TEIGridService.generateGridColumns($scope.attributes, $scope.selectedOuMode.name, true);
$scope.gridColumns = grid.columns;
@@ -363,17 +366,17 @@
if($scope.pager && $scope.pager.page && $scope.pager.pageCount && $scope.pager.page > $scope.pager.pageCount){
$scope.pager.page = $scope.pager.pageCount;
}
- $scope.search();
+ $scope.search(null,true);
};
$scope.resetPageSize = function(){
$scope.pager.page = 1;
- $scope.search();
+ $scope.search(null,true);
};
$scope.getPage = function(page){
$scope.pager.page = page;
- $scope.search();
+ $scope.search(null,true);
};
$scope.clearEntities = function(){