angular-ui/ui-grid

getTotalPages() is working wrong for Custom pagination

Open

#6,246 创建于 2017年6月2日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)JavaScript (2,496 fork)batch import
good first issue

仓库指标

Star
 (5,395 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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 ....

贡献者指南