Author Topic: Sort by Number of Badges Broken  (Read 5331 times)

Dyffwd

  • Minion
  • **
  • Posts: 28
Sort by Number of Badges Broken
« 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.

Steiner

  • Elite Boss
  • *****
  • Posts: 1,602
    • Steinerd.com
Re: Sort by Number of Badges Broken
« Reply #1 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.
« Last Edit: April 19, 2009, 05:12:25 PM by Steiner »
~Steinerd

Dyffwd

  • Minion
  • **
  • Posts: 28
Re: Sort by Number of Badges Broken
« Reply #2 on: April 19, 2009, 06:25:58 PM »
You rock man, it's fixed now.

Thanks!

elizibar

  • Underling
  • *
  • Posts: 14
Re: Sort by Number of Badges Broken
« Reply #3 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.
« Last Edit: June 21, 2009, 05:57:32 AM by elizibar »

SaintNicster

  • Elite Boss
  • *****
  • Posts: 865
Re: Sort by Number of Badges Broken
« Reply #4 on: June 21, 2009, 02:15:23 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.


Snow Globe

  • Lieutenant
  • ***
  • Posts: 63
Re: Sort by Number of Badges Broken
« Reply #5 on: July 03, 2009, 08:40:49 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".



Steiner

  • Elite Boss
  • *****
  • Posts: 1,602
    • Steinerd.com
Re: Sort by Number of Badges Broken
« Reply #6 on: July 03, 2009, 09:00:21 PM »
Yea this will probably require a custom parser. That sucks... lol
~Steinerd

SaintNicster

  • Elite Boss
  • *****
  • Posts: 865
Re: Sort by Number of Badges Broken
« Reply #7 on: July 03, 2009, 09:17:14 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.


SaintNicster

  • Elite Boss
  • *****
  • Posts: 865
Re: Sort by Number of Badges Broken
« Reply #8 on: July 24, 2009, 08:08:54 PM »
This should be fixed (for now?)


Snow Globe

  • Lieutenant
  • ***
  • Posts: 63
Re: Sort by Number of Badges Broken
« Reply #9 on: August 01, 2009, 07:05:42 PM »
This should be fixed (for now?)
Yes, thanks!