Hi,
im working on a pager for a client.
Here's how it should work.... Let's assume we've got many products. I don't want to show them all at once. But let's say 10 per page.
The pager should not display all pages as links, but it should be configurable. Let's say I want to show a maximum of 10 'pager' links including a link to the first page and a link to the last page. And also including a kind of seperator (not linked).
So, on the first page the page should look something like:
[1] [2] [3] [4] [5] [6] [7] [8] [..] [43] (total: 10)
On page 9 the page should look something like:
[1] [..] [9] [10] [11] [12] [13] [14] [..] [43] (total: 10)
On page 43 the page should look something like:
[1] [..] [36] [37] [38] [39] [40] [41] [42] [43] (total: 10)
My question is:
How do I calculate these 'ranges'?
im working on a pager for a client.
Here's how it should work.... Let's assume we've got many products. I don't want to show them all at once. But let's say 10 per page.
The pager should not display all pages as links, but it should be configurable. Let's say I want to show a maximum of 10 'pager' links including a link to the first page and a link to the last page. And also including a kind of seperator (not linked).
So, on the first page the page should look something like:
[1] [2] [3] [4] [5] [6] [7] [8] [..] [43] (total: 10)
On page 9 the page should look something like:
[1] [..] [9] [10] [11] [12] [13] [14] [..] [43] (total: 10)
On page 43 the page should look something like:
[1] [..] [36] [37] [38] [39] [40] [41] [42] [43] (total: 10)
My question is:
How do I calculate these 'ranges'?