Client-side Sorting with the DOM
I'm amazed at how easy it is to sort an HTML table with the DOM and JavaScript. I whipped up a quick modification of Porter's Sort Table Rows demo. The basic enhancements I
made where removing the <a>'s from the table headers, and just adding an onclick
handler to the <th>'s. I also added indicators to display the the current
column/direction that's sorted. Seems to work in most of the browsers too! On Windows
2000, this includes IE6, IE5.5, Opera 7 and Phoenix 0.5. On OS X, the latest versions of
Safari, Chimera, IE, Mozilla and Netscape. It doesn't work on OmniWeb, and the
cursor: pointer
doesn't work on the <th>'s in IE/Mac and IE5.5/Win.
Anyway, you can checkout the
demo or download with
the relevant HTML, .gif and .js files. I've also included it below for your convenience.
I'd love to add this sort of capability to the display tag library.
Posted by Lance on February 11, 2003 at 10:14 PM MST #
Posted by Cesar Sandoval on February 12, 2003 at 04:59 PM MST #
Posted by Tom on January 26, 2004 at 06:50 PM MST #
Posted by Gary Burke on May 10, 2004 at 02:42 PM MDT #
Posted by kleineikenscheidt/stefan on September 16, 2004 at 06:50 PM MDT #
Posted by Roman on June 29, 2005 at 05:08 PM MDT #
Posted by Robert C. Morreale on December 02, 2005 at 01:21 AM MST #
Posted by Nagraj on December 13, 2005 at 09:26 AM MST #