SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pagination with 2000 pages

    Hey all,

    I'm stuck thinking how to resolve a small issue I have with some data i'm getting from ebay.

    I've written some code to proxy an ebay web service, and its working great, but I need a way to cleanly deal with pagination.

    Say I search for Star Wars, I get 293572 results and you can only return 100 at a time, thus leaving me with 2936 pages. Using the code i've writen, it's going to be messy displaying nearly 3000 links for pagination.

    I've seen on numerous places 1, 2, 2000, 2001, 2002, 2003, 2935, 2936.

    Does anyone have any idea's on how I can deal with said amount. At the moment I have a First Previous 1 2 3 (etc) Next Last.

    Thanks in advance!


  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I think the best way is a bit like what you've seen. Say you're on page 1066. Then I would prefer to see something like this:

    1 2 3 ... 1064 1065 1066 1067 1068 ... 2934 2935 2936

    A bit like very long threads on this forum. It must also include a little box where I can input a specific page number, in case I want to go to page 2148 from page 1066. That is very important.

    The way eBay does it with feedback is also quite good, though it would be a little better with First and Last there as well:

    Page 44 of 1,585 Previous 41 | 42 | 43 | 44 | 45 | 46 | 47 Next Go to page

    (with a little text input box after "Go to page")

  3. #3
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At teh moment I have it so that it displays the previous and next four pages and then I have the first, previous, next and last buttons.

    A bit like the example you've provided from ebay.

    Thanks


  4. #4
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I don't think you can do much better than that, as long as you include the box to allow the user to input a specific page.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •