Closed Bug 334773 Opened 18 years ago Closed 8 years ago

Allow local Table sorting

Categories

(Core :: Layout: Tables, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: aveclafaux, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2

When a set of data is displayed in a table with multiple row, it is often interesting to be able to sort the data with respect to each of the row - but this opportunity is rarely given by the websites. A typical example is in Wikipedia (http://en.wikipedia.org/wiki/Human_Poverty_Index), where the table code is very simple.
Of course, we may think that the resposnsibility to provide sorting may reside in the hand of the website, but there are good enough (Javascript) table sorting algorithm around that would do that locally - without a call to the server. 


Reproducible: Always




I suggest we should implement such an algorithm and for a simple and non intrusive UI I can see two primary way :
- a 'sort by %name of the header%' could be inserted in the context-menu when we 'right-click' on a table header (<th> tag)
- each <th> could be attached with an arrow which when clicked will do the sort. Of course this would be more tricky as it could interfere with link placed inside the <th> and we may need to use something like the Forward/Backward arrow, which is a bit ugly...

And yes definitely it could be a nice project for an extension first :-)
I like the idea of putting this feature in the context menu for <th>.  That would keep it from breaking page layouts, and keep it from appearing on most non-data tables (e.g. layout tables).  It wouldn't be very discoverable, though, and it wouldn't work at all on the many sites that have data tables without <th>.

See http://www.squarefree.com/bookmarklets/pagedata.html#sort_table for one JavaScript implementation that works on many sites.
Component: General → Layout: Tables
Product: Firefox → Core
QA Contact: general → layout.tables
We'll leave this for developers to solve through custom elements.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.