Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Smart pagination for better usability
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
wildchild  
View profile  
 More options Aug 15 2009, 7:59 pm
From: wildchild <alexander.uva...@gmail.com>
Date: Sat, 15 Aug 2009 16:59:21 -0700 (PDT)
Local: Sat, Aug 15 2009 7:59 pm
Subject: Smart pagination for better usability
Just an idea. Consider we have page_size = 20 and just 23 records in
the storage. Why not display all 23 records without annoying "next
page" link? Awesome?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Wilson  
View profile  
 More options Aug 18 2009, 7:33 am
From: Ben Wilson <dau...@gmail.com>
Date: Tue, 18 Aug 2009 04:33:20 -0700 (PDT)
Local: Tues, Aug 18 2009 7:33 am
Subject: Re: Smart pagination for better usability
What you're looking for is a "fudge factor"? If the last page contains
fewer than, say, 30 percent of the remaining records...

On Aug 15, 7:59 pm, wildchild <alexander.uva...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mislav Marohnić  
View profile  
 More options Aug 18 2009, 9:59 am
From: Mislav Marohnić <mislav.maroh...@gmail.com>
Date: Tue, 18 Aug 2009 15:59:11 +0200
Local: Tues, Aug 18 2009 9:59 am
Subject: Re: Smart pagination for better usability

On Sun, Aug 16, 2009 at 01:59, wildchild <alexander.uva...@gmail.com> wrote:

> Just an idea. Consider we have page_size = 20 and just 23 records in
> the storage. Why not display all 23 records without annoying "next
> page" link? Awesome?

Awesome? It frikkin' rules!

But seriously—I've given this a thought when I was experiencing
disappointment if the last page had only a few records. But, having a
constant per_page value was good for consistency, so I never really dared to
cheat on my users this way.

It's easy to implement this if anyone wants to try it:

    class Post < ActiveRecord::Base
      def self.paginate(options)
        result = super
        if result.total_pages > 1 and (result.total_entries - result.size)
<= result.per_page/4
          result += super(options.merge(:page => result.next_page))
          result.paginate(:page => 1, :per_page => result.size)
        else
          result
        end
      end
    end


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »