Closed vchalub closed 7 years ago
The same issue can be replicated when the page size is set to 20, the page number is 1 to 3, total number of results is 105. MaxNrOfPages is set to 5 Expected display : [previous] 1 2 3 4 5 ... [next] Acctual display : [previous] 1 2 3 4 5 [next]
Fixed, thanks for the detailed report.
Hi, I found an issue when I have the number of pages as same as the default (10) or what I set in the option MaxNrOfPages. The last page does not appear, unless I click on a page closer to the end. For example, if I have 10 pages on total e set MaxNrOfPages(9), at first it shows only 1 to 9. Then, if I click on page 7, it shows the pages 1 to 10.
To fix this issue for me, I changed the class Pager, method BuildPaginationModel. Where it says:
if (end < pageCount - 1) { model.PaginationLinks.Add(new PaginationLink { Active = false, DisplayText = "...", IsSpacer = true }); }
I changed to:if (end <= pageCount - 1) { model.PaginationLinks.Add(new PaginationLink { Active = false, DisplayText = "...", IsSpacer = true }); }
Then, it shows like this: 1 2 3 4 5 6 7 8 9 ... For me, this change was enough. Just letting you guys know.
Cheers,
Vanessa