Author Topic: New table sorting library  (Read 23616 times)

0 Members and 3 Guests are viewing this topic.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 09:42:37 pm
New table sorting library
« on: May 31, 2022, 10:42:21 pm »
Many tables in TM are sortable by different columns by clicking on the column header.  The table sorting library we have been using for years has had some problems.  I've gone through and replaced all sortable tables with the one at https://github.com/tofsjonas/sortable .

Please try sorting tables on various pages on the staging server, https://tmstage.teresco.org/ , and let me know if you notice any problems.  Functionality should be very similar to what we had before, except it should work more consistently. If things are looking good after a short testing period, I'll install this version on the main site.

Offline Markkos1992

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 3301
  • Last Login:Yesterday at 10:44:11 pm
Re: New table sorting library
« Reply #1 on: June 01, 2022, 06:39:39 am »
Is the functionality there yet?  The tmstage site shows an ongoing update.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 09:42:37 pm
Re: New table sorting library
« Reply #2 on: June 01, 2022, 07:36:05 am »
Is the functionality there yet?  The tmstage site shows an ongoing update.

Should be.  The ongoing update messaging was a remnant of a previous test of something else, which I've now removed.

Offline Markkos1992

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 3301
  • Last Login:Yesterday at 10:44:11 pm
Re: New table sorting library
« Reply #3 on: June 01, 2022, 08:15:54 am »
The total clinchable in the stats table for a region IMO should not be sortable.  Nothing else noticeable from what I have seen.

I would like to be able to sort the line at the top of the Route Finder, but I presume that may be a loading issue.
« Last Edit: June 01, 2022, 08:27:52 am by Markkos1992 »

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:November 20, 2024, 11:21:09 am
Re: New table sorting library
« Reply #4 on: June 01, 2022, 08:56:46 am »
The user page table content should be right-aligned again.

The total clinchable in the stats table for a region IMO should not be sortable.

Why?

Offline Markkos1992

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 3301
  • Last Login:Yesterday at 10:44:11 pm
Re: New table sorting library
« Reply #5 on: June 01, 2022, 11:05:15 am »
The total clinchable in the stats table for a region IMO should not be sortable.
Why?

Personally, I do not like it getting in the way of usernames especially if I ever want to use the data in a personal spreadsheet.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:November 20, 2024, 11:21:09 am
Re: New table sorting library
« Reply #6 on: June 01, 2022, 12:04:52 pm »
@Jim, have you changed anything in the last three hours? The user page tables are sorted by region and system name now. I'm quite sure that it was by clinched miles (region) and % clinched three hours ago - just as it should be!

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:November 20, 2024, 11:21:09 am
Re: New table sorting library
« Reply #7 on: June 01, 2022, 12:05:53 pm »
The total clinchable in the stats table for a region IMO should not be sortable.
Why?

Personally, I do not like it getting in the way of usernames especially if I ever want to use the data in a personal spreadsheet.

You don't need to sort it if you don't want to. I thinkt it's fine that it's possible.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 09:42:37 pm
Re: New table sorting library
« Reply #8 on: June 01, 2022, 01:07:39 pm »
@Jim, have you changed anything in the last three hours? The user page tables are sorted by region and system name now. I'm quite sure that it was by clinched miles (region) and % clinched three hours ago - just as it should be!

I haven't, but I bet I need to specify an initial sorting that differs from the order that comes out of the DB in those cases.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 09:42:37 pm
Re: New table sorting library
« Reply #9 on: June 01, 2022, 01:10:15 pm »
The total clinchable in the stats table for a region IMO should not be sortable.  Nothing else noticeable from what I have seen.

Agreed, that should not move from the top.  I will see what I can do.

Quote
I would like to be able to sort the line at the top of the Route Finder, but I presume that may be a loading issue.

If I understand what you mean, I think that shouldn't be too hard.  So you'd like to be able to sort by each of the column headers on findroute.php?  I just have to make sure the filter drop-downs are excluded.

Offline Markkos1992

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 3301
  • Last Login:Yesterday at 10:44:11 pm
Re: New table sorting library
« Reply #10 on: June 01, 2022, 01:44:05 pm »
Quote
If I understand what you mean, I think that shouldn't be too hard.  So you'd like to be able to sort by each of the column headers on findroute.php?  I just have to make sure the filter drop-downs are excluded.

Basically.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 09:42:37 pm
Re: New table sorting library
« Reply #11 on: June 01, 2022, 08:08:08 pm »
@Jim, have you changed anything in the last three hours? The user page tables are sorted by region and system name now. I'm quite sure that it was by clinched miles (region) and % clinched three hours ago - just as it should be!

I haven't, but I bet I need to specify an initial sorting that differs from the order that comes out of the DB in those cases.

The version on tmstage should now sort as it did before.

Is this the behavior we want?  I am not sure why the by-region table sorts by distance traveled while the by-system sorts by % traveled.

Offline formulanone

  • Full Member
  • ***
  • Posts: 141
  • Last Login:November 20, 2024, 11:28:08 am
Re: New table sorting library
« Reply #12 on: June 01, 2022, 09:05:43 pm »
Sorting by percentages for each region puts the values in order by the first or second digit. This means that 100.00% values appear after the 19-11.x% values, but all 10.xx% values appear after the 100%. Then 1.xx% values appear after 10%, instead of below the 9.99-2.00%, et cetera.

Otherwise, I do like the ability to sort the column headers (for example, finding the longest or shortest routes in a system).
« Last Edit: June 01, 2022, 09:08:11 pm by formulanone »

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 09:42:37 pm
Re: New table sorting library
« Reply #13 on: June 01, 2022, 10:39:48 pm »
I think I've fixed all the problems mentioned here, and added column sorting functionality on findroute.  Check out the current version on tmstage and let me know if I missed anything.

Offline Markkos1992

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 3301
  • Last Login:Yesterday at 10:44:11 pm
Re: New table sorting library
« Reply #14 on: June 01, 2022, 11:37:40 pm »
At the top of the page, the stats page is not showing the color on distance traveled for me for active only now.

I am also getting an "out of memory" error whenever I try to use the route finder.  I want to think it was something on my end, but I am unsure.
« Last Edit: June 01, 2022, 11:55:18 pm by Markkos1992 »