Bug Reports

Forum >> Bug Reports >> Class Order   Bookmark This Forum Thread

Post ID Date & Time Game Date Function
Evaristo
Joined: 01/06/2021
Posts: 52

Inactive

Hardwood College Basketball
If you order your players by Class, you get it alphabetically SR > SO > JR > FR.

This can be confusing for non American managers. I was thinking that SO=3rd year until I happened to press "show details" and I saw the ages besides the class.
admin
Joined: 01/24/2017
Posts: 2385

Hardwood Administrator

Hardwood College Basketball
This isn't a bug, it's just alphabetical. However, I understand the problem. There is also an issue with the RS player too. I don't have a better solution yet, but continue to look for one.


Steve
ryhaggs
Joined: 01/30/2019
Posts: 34

Eckerd Tritons
IV.3

Hardwood College Basketball
I'm not a developer or anything, so this may be impossible, but could you define each class with a number 1=FR, 2=RS FR, 3=SO, etc, then it sorts it numerically, but displays the text related to the number.
naph
Joined: 02/29/2020
Posts: 578

St. Marys Gaels
II.1

Hardwood College Basketball
// Disclaimer: I was more a desktop application dev than a web dev, and the code below is untested.

Looks like you're using the tablesorter jquery plugin.

tablesorter documentation

From the above link it looks like you'd need something like...
Code:
// add parser through the tablesorter addParser method $.tablesorter.addParser({ // set a unique id id: 'playerclass', is: function(s, table, cell, $cell) { // return false so this parser is not auto detected return false; }, format: function(s, table, cell, cellIndex) { // format your data for normalization return s.toLowerCase() .replace(/jc so/,9) .replace(/hs sr/,8) .replace(/rs sr/,7) .replace(/sr/,6) .replace(/rs jr/,5) .replace(/jr/,4) .replace(/rs so/,3) .replace(/so/,2) .replace(/rs fr/,1) .replace(/fr/,0); }, // set type, either numeric or text type: 'numeric' }); $(function() { $("table").tablesorter({ theme: 'blue' // "sorter-playerclass" added as a class name in the HTML (new in v2.0.11) // or un-comment out the option below // ,headers: { 23: { sorter: 'playerclass' } } }); });

See the link above for the 2 different ways you could then call that from the html.

Updated Wednesday, January 20 2021 @ 8:20:06 am PST
admin
Joined: 01/24/2017
Posts: 2385

Hardwood Administrator

Hardwood College Basketball
Yeah...I'm using an off-the-shelf table sorter and I just haven't gone back and tried to improve it so far.


Steve
Henry Morgan
Joined: 06/25/2020
Posts: 9

Inactive

Hardwood College Basketball
do the same thing with players height

thats not too good
pschwartz
Joined: 05/07/2019
Posts: 857

Richmond Spiders
II.2

Hardwood College Basketball
A workaround on height is to change it to "English (Inches only)". That is what I do so that I can sort on height. It does require some math but once you get used to it seeing it inches becomes second nature.

You can do that if you click on profile on the left, the update settings box. The option is "Change measurement units:"


Previous Page | Show All |