||View All MessagesBack to WebFX|
I got it working, had to add a primary and secondary sort setting to maintain a consistent sort order.
From: Mike C.
Sent: November 12, 2004
Subject: Re:SortableTable 1.12 - Maintaining Sort Order On Redisplay
I set up a small test to demonstrate this in case my description above is unclear.
Go to this link: http://www.16mm-films.com/testsort.htm
(Note: You may see a screen warning of browser incompatibilities - just uncheck the "Notify me whenever a possible conflict is detected" checkbox and press the "Return to 16mm-Films.com" button. This won't do anything harmful, it will create a cookie saying not to warn you about possible browser incompatibility issues at my site, nothing more).
To demo the problem:
1. Click on the "FilmAuction ID" header. I've got an alert() coded in sortabletable.js in updateHeaderArrows that will display the values of this.sortColumn and this.descending (it also saves current values in a cookie). Note that this.sortColumn is 2 and this.descending is false. Make a mental note of the table appearance, but as reference user 'ssigel' will be the last entry in the table.
2. Click on any anchor in the table body.
3. Click the BACK button on your browser to return to the test page. You will see the alert()'s referenced above. There are two, the first is where the table is first built (typically values are 'null') and the second is where we call st1.sort() with our specific sort parameters - which will be the same as #1 above (sort on column 2 ascending).
4. Look at the table displayed, Although we called st1.sort() to sort on column 2 ascending it is sorted descending (as reference, user 'ssigel' is now at the top of the column).
Is this a bug in SortableTable.js or am I doing something wrong or calling it incorrectly? You can view source to see how I'm calling it, but if it's any easier after the table is built I execute the following:
lastSort and absOrder were, again, saved in a cookie in the updateHeaderArrows section of sortabletable.js and indeed are being set/retrieved correctly.
Thanks in advance for your help. I'm really looking forward to getting this working, it's a mighty fast sort! :)