There are two different sorts being done: one when the data is initially pulled from the DB, and one when a header column is clicked. Once you click the header column, hit save, then reload the page, it becomes a DB sort again.
Currently, the header column bit keeps getting confused because of the stuff added to the end of some columns ( "... badges", "... days offline", etc). I haven't had the time to really figure out how to get those to sort correctly.
I just tried to sort my character list and discovered an unexpected behavior.
This can be ascending or descending. Sorting by days offline is done by character, not numerically. What does that mean?
It means this:
1, 11, 2, 29, 3, 38, 4, 42, 5, 50, 52, 6, 67, 7, 8, Today
Instead of this:
Today, 1, 2, 3, 4, 5, 6, 7, 8, 11, 29, 38, 42, 50, 52, 67
Please fix?
-----------
As to a possible solution:
I'm not familiar with jQuery, but I do know Mootools and Javascript
, but couldn't you do something along these lines?
Grab the row's data, shove that into an array (I assume this already is happening) before sorting.
If you use regular expressions to determine the "number" portion of the field, just grab the substring of that field. If the value equals "today" then value=0. At that point sort, then reformat the values back to the "XX days offline".