in reply to Sorting a table
You can do this server side by making links that define calls which call back to your script with a parameter telling the sort key and perhaps a direction. You'd then use that sort key to sort the table into a temporary AoA which you'd use to output your table.
Another alternative which you might want to look into (if it's acceptable to use Javascript) is any of the umpteen bazillion JS live table packages (see for example Yahoo's YUI). These have the advantage of sending the page one time and then the sorting takes place client side rather than requiring a server round trip. You could also use JQuery to whip up your own if you need fancier behavior that an off the shelf solution doesn't provide.
An unrelated note: don't prefix subroutine calls with an &; it has a special meaning which while you're probably not going to get into trouble here could cause headaches down the road if you get into a bad habit.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting a table
by pc0019 (Acolyte) on Jul 03, 2008 at 01:11 UTC |