Incorrect table sorting

SchwallexSchwallex Member Posts: 121
edited August 2013 in Brickset.com
The "Your Minifig Collection" table at http://brickset.com/minifigs/owned/ sorts the numbers alphabetically rather than numerically. Observe:

image

I suppose that's a general problem, not just with that one table, but I haven't checked as I struggle to think of other pages with sortable tables right now, though I am sure they exist.

I searched the forums, but obviously keywords such as "sorting" and "minifig collection" are heavily overloaded. Apologies if this has been brought up before.

Comments

  • graphitegraphite USMember Posts: 3,241
    When I go to that page and click on the column title it correctly sorts it from 100 > 0 and 0 > 100 alternating.
  • SchwallexSchwallex Member Posts: 121
    The "Total" and "Not owned" columns are sorted correctly for me as well. But the "Owned" and "% owned" columns are not. Quite strange. I'm using Chrome right now, if that matters.
  • graphitegraphite USMember Posts: 3,241
    Chrome here as well. All 4 sort properly.
  • CapnRex101CapnRex101 United KingdomAdministrator Posts: 2,272
    edited August 2013
    Same as @graphite here, I am on Chrome and by clicking any of the table headings the numbers are shifted from alphabetical order to numerical order.
  • graphitegraphite USMember Posts: 3,241
    ^ I don't get alphabetic at all. Just increasing and decreasing numerical ordering. I never see it ordered the way he has listed. Alphabetical ordering for numbers ignores the length of the number and starts from the first character. 1 10 100 2 20 200 vs numerical 1 2 10 20 100 200.
  • CapnRex101CapnRex101 United KingdomAdministrator Posts: 2,272
    ^ Well in that case, try clicking on the column headings @Schwallex and see if that helps.
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,441
    IE9 here and all four columns sort properly. The sorting is done by a JavaScript library and is data-sensitive so it recognises that the columns contain all numeric data and sorts accordingly.
  • SchwallexSchwallex Member Posts: 121
    edited August 2013
    @CapnRex101 yeah that's precisely what I'm doing, as you can see from the screenshot I posted. In fact that's how I ran into this in the first place.

    @Huw, thank you the quick response. Just tried in IE9, same thing as with Chrome:

    image

    This is Vista Home Premium. Will try on my machine at work next week, where I'm running Ubuntu+FF.
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,441
    Actually it's IE10 here, maybe there's a problem with IE9...
  • martynmartyn Reading, UKMember Posts: 148
    ^ I'm getting the incorrect sorting problem in IE10 as well
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,441
    I'm using http://tablesorter.com/docs/. Do the demos work for you?
  • SchwallexSchwallex Member Posts: 121
    edited August 2013
    @Huw: They do, though they don't seem to showcase quite the same scenario anywhere. (In the "Age" column, all numbers are of the exact same length, and in all other columns there are decimal points and percentage or currency signs and whatnot, which probably trigger a different treatment altogether.)

    Also, as I mentioned, the "Total" and "Not owned" columns here on Brickset are being sorted correctly for me. It's only the "Owned" and "% owned" columns that aren't. Two out of four. No idea why that would be, but one difference I'm seeing is that the incorrectly sorted columns have cells with zeroes in them, while the correctly sorted ones are populated with positive integers only. Correlation ≠ causation, of course, but that's something I noticed.
  • emilewskiemilewski CT, USAMember Posts: 475
    Confirmed with alphabetic sorting on Owned and %owned (which have 0 values in the column). Using FF but I doubt that matters. (Huw owns everything almost so has no zeroes in his columns so is not a good test).
    Schwallex
  • plasmodiumplasmodium UKMember Posts: 1,936
    @Schwallex, have you tried clearing out the browser cache or cookies or something like that? If you and @Huw are both using IE and getting different results, then it could be something like that...
  • Tevans333Tevans333 Member Posts: 150
    I have the same sorting issue on IE9, but to add to it, It also considers items marked as wanted as owned.

    Example; I own 10 Spiderman figures and have 20 marked as wanted. When viewing Owned and % Owned it reports 30 and 100%.
  • boba_jagoda2boba_jagoda2 Member Posts: 25
    This perhaps does not belong here - but there is someting off with how Series 9 is being counted. Unlike series 1-8 (17 "sets") it consists of "19" sets?
  • SchwallexSchwallex Member Posts: 121
    This is Firefox 22 under Linux. Still the exact same problem, as you can see:

    image
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,441
    edited August 2013
    All very weird. It's supposed to handle numbers that are hyperlinks as well, and for many of us, it does!
  • HuwHuw Brickset Towers, Hampshire, UKAdministrator Posts: 6,441
    @boba_jagoda2, they all consist of 19 'sets': 16 figs, one sealed bag, one complete set and one sealed box.

    S10 of course consists of 20, what with our friend Mr. Gold...
  • boba_jagoda2boba_jagoda2 Member Posts: 25
    I always tick individual figures and complete set and leave out random and sealed, this is the screen shot of collection analysis:
    b.jpg 70.4K
Sign In or Register to comment.

Recent discussions Categories Privacy Policy