The paging worked when data was populated on load. After I included enteredValue/search functionality to populate ng-grid I no longer see 5 items per page and the next/previous buttons don't work. I believe the change of data in gridOptions from 'myData' to 'source' broke the pagination. I am trying to pass $scope.source into setPagingData function but having issues. How do I get the paging to work properly?
$scope.setPagingData = function(data, page, pageSize) {
var pagedData = data.slice((page - 1) * pageSize, page * pageSize);
$scope.myData = pagedData;
$scope.totalServerItems = data.length;
if (!$scope.$$phase) {
$scope.$apply();
}
};
$scope.gridOptions = {
data: 'source',
enablePaging: true,
pagingOptions: $scope.pagingOptions,
showFooter: true
};
Here's plunker
getPagedDataAsyncreceives array of objects into parameterurland it's expected that$http.get(url)fails... Also is there a reason to use so outdated angular version? I found it easier to debug in 1.2.1 - Kirill Slatin