Return to Project-GC

Welcome to Project-GC Q&A. Ask questions and get answers from other Project-GC users.

If you get a good answer, click the checkbox on the left to select it as the best answer.

Upvote answers or questions that have helped you.

If you don't get clear answers, edit your question to make it clearer.

+1 vote
484 views

(This is an “answer my own question”-style entry, like on Stackoverflow. I recherched it.)

I was wondering whether we can sort by Difficulty and Terrain separately; some tables have (had?) a combined D/T field, and sometimes I wanted to sort by Terrain first, then Difficulty (e.g. to consider T4 first when filling up my 81 matrix, T4½ later, etc).

In a combined D/T field, this is obviously not possible. When D and T are separate table columns, this is possible with a stable sort.

in Support and help by mirabilos (2.7k points)

1 Answer

+2 votes
 
Best answer

The jQuery tablesorter plugin fork Project-GC uses does have a sortStable option, but it is not enabled. I tried to enable it with an interception proxy (burp), but this did not work.

However, I found that the tablesorter plugin allows multi-column sort:

  1. Click on the first column you want to sort (the outer-most sort, e.g. Terrain in my case)
  2. Shift-click on the second column you want to sort (e.g. Difficulty in my case)
  3. if necessary, shift-click on a third, fourth, etc. column…

Et voilà, I have my rows sorted by Terrain first, then Difficulty within the same Terrain value.

This might make a useful “Did you know? tip of the day”.

by mirabilos (2.7k points)
Thanks for a great answer. It's actually listed in "Did you know".
"That most tables can be sorted by clicking the headers. Hold down the shift key to sort on multiple columns."

In the future, it's likely that we will leave tablesorter behind us and use jqGrid for everything. Today we use it mainly for the VGPS.
Oh okay. I tried to search the “Did you know” tips, but couldn’t find a full list.

I hope jqGrid supports sorting by multiple columns…
...