Re: New SlidingWindowPager Class
| From: | Lorenzo Alberton | Date: | Tue, 12 Nov 2002 12:26:08 +0000 |
| Subject: | Re: New SlidingWindowPager Class | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-10721@lists.php.net to get a copy of this message | ||
12/11/2002 13.26.08
> > Sorry, it's a free host...
> > I set up another test box here:
> >
> >
> > http://cambiano.onlinein.it/pearzone/SWPager/SWPager_example1.php
> >
> > http://cambiano.onlinein.it/pearzone/SWPager/SWPager_example2.php
> >
> > http://cambiano.onlinein.it/pearzone/SWPager/SWPager_example3.php
> >
> > The server should be a lot faster too :-)
>
>
> Thanks for the extra work, Lorenzo.
> It looks good for me so +1.
Thank you!
> I have a feature request though :)
> It would be cool to have the possibility to use a google like
> algorythm to display pages but with the same number of pages all the
> time. At the moment, when you are on page one, it only returns 4 page
> links. Then when you are on page 4, it returns 6 page links.
Yeah, I know... well... actually that's the wanted behaviour :-)
It's a "sliding window pager" after all... if the window is out of
range, it is "shortened"... :-)
When I wrote this pager, I wanted it to work like this:
- show the current page number, plus $delta items before and $delta
after. This way, current page number is always displayed at the
*center* of the group.
- if current page number is less than $delta, show only remaining (if
any) items on the left, and continue displaying $delta numbers on the
right
- similarly if current page number is less than $delta number from the
last page ...
- If current page is not #1, show "previous link" and a link to the
first page.
- if current page is not the last one, show "next link" and a link to
the last page.
With this said, I certainly could add another option to make it work
as you suggested (leaving thus the choice of the desired behaviour to
the user)
Just give me some time... :-)
I don't know if I manage to do it rapidly because I want to do it well
(especially regarding performances) and I'm in a exam session...
so not much time to dedicate to it... doh!
Thanks for your input (and to Pierre-Alain too...)
Regards
Lorenzo
---
[Quipo ISP - Questa E-mail e' stata controllata dal programma Declude Virus]
[Quipo ISP - This E-mail was scanned for viruses by Declude Virus]