angularUtils
angularUtils copied to clipboard
There is a problem with your last page...
if the last page is sent to the server, there are no results listed.. this lists the second last page, so that results can be displayed. Please let me know if you disagree. PS I am using server side pagination
Hi,
I'm not sure I totally understand. So, let's say the server has 123 items, and we list 10 per page. So with the current code:
var totalPages = Math.ceil(collectionLength / rowsPerPage);
= Math.ceil(123 / 10)
= 13
So we would display links 1 ... 13.
- Page 1 contains items 1 - 10,
- page 2 contains 11 - 20
- and so on.
- Page 12 (second to last) contains items 111 - 120.
So we need page 13 to list the final 3 items.
Does that make sense, or am I missing something ;)