2017-02-09 71 views

回答

0

的關鍵點是使用gridApi到captuer的頁面數量的變化:

onRegisterApi: function(gridApi) { 
     $scope.gridApi = gridApi; 
     gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) { 
     paginationOptions.pageNumber = newPage; 
     paginationOptions.pageSize = pageSize; 
     $scope.pageSize = pageSize; 
     $scope.currentPage = newPage; 
     $scope.totalPage = Math.ceil($scope.gridOptions.totalItems/$scope.pageSize); 
     }); 
    } 

整個版本可以看到here in Plnkr