I have a simple cfm page. I am generating a table from a database and would like to be able to re-order the table according to the different headers in it. The page is at http://saugus.byu.edu/gened/alcuin.cfm
Here is the code I am using to order the page now:
<cfquery name= "AlcuinQuery" datasource= "awards">
SELECT * FROM AlcuinRecipient ORDER BY "ID" DESC
I would like to be able to let the user click on the header to sort either ascending or descending by year, name, position, or department. I could do it fairly easily by creating different pages that linked to the header, but I would like to do it all in one page.
In other words, if you click on year then the page will be sorted by year (descending). If you click on year again it will re-sort the page and make the years ascending. If you click on name it will order the table according to name...etc.
Please let me know any suggestions you have (and if this makes sense).