Commit 135af26f authored by manikanta's avatar manikanta

Fixing Pagination for grid

parent c2e2d5e8
...@@ -51,7 +51,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -51,7 +51,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
url : appConfig.appUri + "accounts" url : appConfig.appUri + "accounts"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
console.log(response) console.log(response)
if(response.data.length > 10){ if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
} }
else{ else{
...@@ -59,12 +59,12 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -59,12 +59,12 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
} }
$scope.gridOptions.data=response.data.records; $scope.gridOptions.data=response.data.records;
myFactory.setAccounts(response.data.records); myFactory.setAccounts(response.data.records);
for(i=0;i<response.data.length;i++){ for(i=0;i<response.data.records.length;i++){
if(response.data[i].status == 'Y'){ if(response.data.records[i].status == 'Y'){
$scope.gridOptions.data[i].status = "Active"; $scope.gridOptions.data[i].status = "Active";
}else if(response.data[i].status == 'N'){ }else if(response.data.records[i].status == 'N'){
$scope.gridOptions.data[i].status = "InActive"; $scope.gridOptions.data[i].status = "InActive";
}else if(response.data[i].status == 'B'){ }else if(response.data.records[i].status == 'B'){
$scope.gridOptions.data[i].status = "Bench"; $scope.gridOptions.data[i].status = "Bench";
} }
} }
......
...@@ -104,7 +104,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -104,7 +104,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
method : "GET", method : "GET",
url : appConfig.appUri + "employees/?status="+$scope.status url : appConfig.appUri + "employees/?status="+$scope.status
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
if(response.data.length > 10){ if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
} }
else{ else{
...@@ -129,7 +129,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -129,7 +129,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
url : appConfig.appUri + "employees/active" url : appConfig.appUri + "employees/active"
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptionsOrgView.data = response.data.records; $scope.gridOptionsOrgView.data = response.data.records;
if(response.data.length > 10){ if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
} }
else{ else{
......
...@@ -85,7 +85,7 @@ myApp.directive('hcPieChart', function () { ...@@ -85,7 +85,7 @@ myApp.directive('hcPieChart', function () {
] ]
}; };
$scope.gridOptions.data = $scope.records; $scope.gridOptions.data = $scope.records;
$scope.gridOptions.enablePaginationControls = false;
$scope.getMyTeamDetails = function(seriesName, category, optionName,title){ $scope.getMyTeamDetails = function(seriesName, category, optionName,title){
......
...@@ -113,8 +113,7 @@ myApp.controller("domainController", ...@@ -113,8 +113,7 @@ myApp.controller("domainController",
}) })
.then( .then(
function mySuccess(response) { function mySuccess(response) {
console.log(response.data); if(response.data.records.length > 10){
if(response.data.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
} }
else{ else{
...@@ -122,7 +121,6 @@ myApp.controller("domainController", ...@@ -122,7 +121,6 @@ myApp.controller("domainController",
} }
$scope.gridOptions.data = response.data.records; $scope.gridOptions.data = response.data.records;
console.log(response.data.records)
}, },
function myError(response) { function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment