WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 SortableTable 1.12 - Maintaining Sort Order On Redisplay, Mike C., November 11, 2004
     Re:SortableTable 1.12 - Maintaining Sort Order On Redisplay, Mike C., November 12, 2004
         Re:SortableTable 1.12 - Maintaining Sort Order On Redisplay, Mike C., November 16, 2004

Subject: Re:SortableTable 1.12 - Maintaining Sort Order On Redisplay From: Mike C. Date: November 12, 2004

Hi Again,

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:

<script type="text/javascript">
    var st1 = new SortableTable("T_auctions", ["String", "String", "String"]);
    getsortvars("T_auctions");
    st1.sort(lastSort, absOrder);
 </script>


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!  :)

-Mike




Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX