angular-ui/ui-grid

getTotalPages() is working wrong for Custom pagination

Open

#6.246 geöffnet am 2. Juni 2017

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.496 Forks)batch import
good first issue

Repository-Metriken

Stars
 (5.395 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Hi guys, In this Pagination api method below

getTotalPages: function () { if (!grid.options.enablePagination) { return null; } if (grid.options.useCustomPagination) { return grid.options.paginationPageSizes.length; } return (grid.options.totalItems === 0) ? 1 : Math.ceil(grid.options.totalItems / grid.options.paginationPageSize); }

in this part:

if (grid.options.useCustomPagination) { return grid.options.paginationPageSizes.length; }

It brokes the pagination, since it will never return the real quantity of pages to use, but the quantity in the pageSizes array ....

Contributor Guide