Pagination does not work
My app dependencies:
window.ethnicApp = angular.module 'ethnicApp', ['templates', 'ngRoute', 'ngResource', 'ui.router', 'angular-loading-bar',
'angularFileUpload', 'ngAnimate', 'ui.grid', 'angular-underscore', 'ui.grid.pagination',
'authModule', 'homeModule', 'itemsModule',
'addItemModule', 'showItemModule']
My html
.grid ui-grid="itemsGridOptions" external-scopes='itemActionsManager' ui-grid-pagination=""
My Controller:
$scope.itemsGridOptions = {
paginationPageSizes: [10, 20, 30],
paginationPageSize: 10,
columnDefs: [
{ name: 'id' }
{ name: 'name' }
{ name: 'description' }
{ name: 'total_likes', displayName: '#Likes'}
{ name: 'seller.email' }
{ name: 'actions', displayName: 'Actions', cellTemplate: 'app/Items/Index/SubViews/ItemAction.html' }
]
}
The page just show a table with 10 rows. No pagination sections at the bottom
Im in same situation. Very confused paging and pagination name. Something happened here?!, Merge pagination and paging features: https://github.com/angular-ui/ng-grid/commit/f8a68ccf7601a1a20f6b5234ad4fcaffa9f7a6fc It works for me with paging with v3.0.0-RC.18
$scope.gridOptions = {
enablePaging: true,
pagingPageSizes: [10, 20, 30],
pagingPageSize: 10,
angular.module('angularSonataAdmin', [ 'ui.grid.paging' ,'ngRoute', 'ui.grid', 'ui.grid.edit', 'ui.grid.resizeColumns', 'ui.grid.selection']
div class="gridStyle" ui-grid="gridOptions" ui-grid-paging ui-grid-edit ui-grid-resize-columns ui-grid-selection
I hope I helped, but I do not know how to change the code later.
Try ui-grid - v3.0.0-RC.18-f8a68cc - 2015-01-02 https://github.com/angular-ui/ng-grid/commit/f8a68ccf7601a1a20f6b5234ad4fcaffa9f7a6fc This version works with pagination
Thanks @extdevelopment
So, just recently there were 2 modules - pagination and paging. Even back then ui.grid.paging wasn't always included into the JS file. 'Stable' RC-18 still has ui.grid.paging, while latest 'unstable' version (v3.0.0-RC.18-f8a68cc) doesn't have it anymore.
It seems that pagination took over from paging, but it works somewhat different. Plus, I'm getting all sorts of issues on IE9 with pagination now - displaying only few rows (out of 50 per many hundreds of pages), styling is all messed up. Not really sure as to why this switch was done.
I'm also having an issue with external pagination. In onRegisterApi, I try to setup my paginationChanged event handler, but in gridApi.pagination.on.paginationChanged pagination is undefined. I do have useExternalPagination set to true.
useExternalPagination: true, not use(r)ExternalPagination, but possible a typo in comment.
I use this code, and working properly.
$scope.gridOptions.onRegisterApi = function(gridApi){
gridApi.pagination.on.paginationChanged($scope, function (pageNumber, pageSize) {
console.log('pager get data: pageNumber, pageSize', pageNumber, pageSize);
getPager(pageNumber, pageSize);
});
};
@extdevelopment Yeah, it was just a typo. I'm using rc16. It looks like I need rc18. I ran bower install angular-ui-grid --save. Do I need to do something else?
I think bower download only "main" release. You need it http://ui-grid.info/release/ui-grid-unstable.js v3.0.0-RC.18-d9b2314 - 2015-01-06 (this version currently available), because pagination refactored since RC.18
the other component is also necessary, I forgot sry https://github.com/angular-ui/ng-grid#how-can-i-test-30
Yeah, I'd build from master. The merge of paging and pagination has broken a few things. @brianchance may also have some thoughts.
I have been testing the paging and pagination with the latest unstable release, and it has been working fine. Just change the word paging to pagination everywhere.
When I first loaded the new .js file, I did have to clear my cache because I received the pagination not defined.
@brianchance did you use bower to install the latest rc?
I did not use bower, I grab them off the release site.
Pagination styling is broken on IE9. Here are the screenshots from IE9 and FF of one of the tutorial pages:
IE9:

FF:

Thanks to the solution posted by @extdevelopment I was able to get pagination in 3.0 RC 18 (bower). Wish I started carousing the github issues a little sooner :)
@kcaron-cst what was your bower install command? Last I tried, I got rc16.
@futurechan this might be the reason: #2324
@futurechan I had to do a resolution in bower, but in my bower.json it looks like:
"angular-ui-grid": "3.0.0-RC.18"
@kcaron-cst Did you make it work? I installed 3.0.0-RC.18. However, It doesn't work for me. :(
@lvarayut (I am @kcaron-cst) This is on my todo list to figure out today. I have pagination controls, but requesting a new page just seems to clear the grid without redrawing the data. Are you not seeing the controls even? My relevant gridOptions are:
enablePaging : true,
pagingPageSize: 100
& I am using gridApi.paging.on.pagingChanged as far as the API is concerned. I'm afraid I will be forced to switch versions to a nightly, which I've been avoiding it due to all the breaking changes, I'd rather deal with them all once RC19 is out.