Matt,

I find that the best is to just reset to the beginning with any change
of sort or pagination. It's too confusing not to. For example, if you
are showing 5 records per page in a 50 record set and you are on page
4, then you suddenly switch to 25 records per page, what should it do?
Throw an error (there is no page 4 anymore)? Or have you on page 2? Or
back to page 1?

And with sorting, if I'm on page 4 of 7 pages sorted by last name,
then suddenly switch to sorting by first name, staying on page 4... at
least to me... is more confusing than just reverting back to page one.
Of course, you could stay on page 4 with the new sort. So sorting
seems to be more of a design choice. But pagination changes: go back
to page 1.

-Danimal

On Sep 8, 12:43 pm, Matt Harrison <[EMAIL PROTECTED]>
wrote:
> Matt Harrison wrote:
> > Hi all,
>
> > I've got a list of machines with columns like so:
>
> > Hostname, Operating System, Location
>
> > I have setup pagination with paginating_find and that works nicely. I
> > have also setup column sorting with my own little helper and
> > controller code. Because I wrote the helper myself I have got it to
> > preserve the page parameter when changing sort mode.
>
> > So when you move to a certain page and do a sort, the page is kept in
> > the same place. However, if I sort a column and then change to a
> > different page, the sorting reverts to the default which makes
> > changing the page useless a lot of the time.
>
> > What is the preferred method to combine column sorting and pagination
> > easily? This must be a fairly common exercise but I can't get my head
> > round how to do it.
>
> > Any help would be appreciated.
>
> Can't believe no-one has any ideas about this, maybe it just got buried
> under all the other mail.
>
> Grateful someone could take a sec to help me :)
>
> Thanks
>
> Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to