Download & Extend

Headers of pager sort the column

Project:Drupal core
Version:x.y.z
Component:base system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

It might be a good idea to make the headers of the pagers links that sort the column. For example phpMyAdmin uses this.
It should be an optional feature, so not all columns are sortable, because sometimes you will not want a column to be sortable.

The approach might be to dynamically set the last part of the pager query: so ORDER BY ... DESC are dynamically created from the url.

this would result in eg:
* http://drupal.org/tracker for default view
* http://drupal.org/tracker/order/author/desc when somebody clicked on 'author header'

Can be done, not easy, but it is possible.

Ber

Comments

#1

just yesterday, i wanted to submit exactly the same feature request.

+10.

(btw, this doesn't look really complicated to me)

#2

Component:page.module» base system

#3

Version:master»

An interesting aproach to sorting is to do it all client-side, thus speeding things up for the user a lot. See this IRT article.

One drawback to client-side sorting is that it doesn't play nice with our notion of paging. It probably makes sense only for shorter tables when all data fits on a single page.

#4

Moshe and I have been working on this feature. It works as expected in it's current state, but Dries would like to see it tweaked a little more so that is easier to use. I'm not sure how to do this, so feel free to hack away and submit.

#5

The current best effort is at
http://lists.drupal.org/pipermail/drupal-devel/2003-July/027401.html

The next step is to integrate this into an existing module (probably one
from Contrib). This will force us to make a clean API that module authors
can easily use. The API is fairly clean already, but may be improved.

I don't expect to work on this either. Hopefully someone else will

#6

a patch introducing this functionality is in my sandbox and awaits review.

#7

nobody click here