angularUtils icon indicating copy to clipboard operation
angularUtils copied to clipboard

There is a problem with your last page...

Open firecentaur opened this issue 9 years ago • 1 comments

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

firecentaur avatar Jun 25 '16 04:06 firecentaur

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 ;)

michaelbromley avatar Jul 07 '16 08:07 michaelbromley