Titan Network

Archive => City Info Tracker => Titan Projects => Bugs and Support => Topic started by: Dyffwd on April 19, 2009, 03:31:09 PM

Title: Sort by Number of Badges Broken
Post by: Dyffwd on April 19, 2009, 03:31:09 PM
On the CIT Web page clicking at the top to sort by number of badges is doing an alpha sort on the numeric data.

IOW all the 0s are together, then all the 1s, be they 1, 10, 11, 14, 123, 154, followed by all the 2s, e.g. 2, 24, 256, and so forth.
Title: Re: Sort by Number of Badges Broken
Post by: Steiner on April 19, 2009, 03:59:16 PM
I edit it, all fields with numbers, percents, dates, etc... should all sort properly.

Give it one more look through and let me know if there is still a table acting up.
Title: Re: Sort by Number of Badges Broken
Post by: Dyffwd on April 19, 2009, 06:25:58 PM
You rock man, it's fixed now.

Thanks!
Title: Re: Sort by Number of Badges Broken
Post by: elizibar on June 20, 2009, 09:54:46 PM
Seems like the same kind of bug has crept back in (which is why I'm posting this as a reply instead of making a new post).  I tried sorting by days offline (I use this to track day jobs on characters I don't play much XD) and I get 1, 10, 11, etc., then 2, 20, and so on.

Edit:  And sometime since that post, it's been fixes.
Title: Re: Sort by Number of Badges Broken
Post by: SaintNicster on June 21, 2009, 02:15:23 PM
Quote from: elizibar on June 20, 2009, 09:54:46 PM
Seems like the same kind of bug has crept back in (which is why I'm posting this as a reply instead of making a new post).  I tried sorting by days offline (I use this to track day jobs on characters I don't play much XD) and I get 1, 10, 11, etc., then 2, 20, and so on.

Edit:  And sometime since that post, it's been fixes.
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.
Title: Re: Sort by Number of Badges Broken
Post by: Snow Globe on July 03, 2009, 08:40:49 PM
Quote from: SaintNicster on June 21, 2009, 02:15:23 PM
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".
Title: Re: Sort by Number of Badges Broken
Post by: Steiner on July 03, 2009, 09:00:21 PM
Yea this will probably require a custom parser. That sucks... lol
Title: Re: Sort by Number of Badges Broken
Post by: SaintNicster on July 03, 2009, 09:17:14 PM
Quote from: Snow Globe on July 03, 2009, 08:40:49 PM
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".
I didn't do anything with the implementation of jQuery, nor have I every dealt with it before. 

It's just a matter of getting the time to sit down and play with it and figure out the best way to fix the problem.  It's a low priority for me now, since the saved DB sort seems to be working fine.
Title: Re: Sort by Number of Badges Broken
Post by: SaintNicster on July 24, 2009, 08:08:54 PM
This should be fixed (for now?)
Title: Re: Sort by Number of Badges Broken
Post by: Snow Globe on August 01, 2009, 07:05:42 PM
Quote from: SaintNicster on July 24, 2009, 08:08:54 PM
This should be fixed (for now?)
Yes, thanks!