View Single Post
Old 01-20-2022, 05:41 PM   #294
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,529
Karma: 8075938
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by SLaSZT View Post
Maybe a dumb question, but how can I set up a custom sort of a custom column? I literally just realized today that custom columns are a thing so I don't know if there's simple code that already does this.

I have a custom column called Status that contains the fixed text values of Reading, Priority, Paused, and Read. I'd like them to sort in that order (descending):
  1. Reading
  2. Priority
  3. Paused
  4. Read

Right now, it seems to be sorting alphabetically. I think that I could probably force it to sort the way I want by explicitly numbering them, but I don't want to have that numbering visible in the column.

Thanks in advance.
You can't set a custom sort. A column is sorted depending on its type. Text columns will sort alphabetically.

As far as I can see, your choices are:
  • Pick words that you understand their meaning and that sort the way you want. It seems that if you replace "Read" with "Finished" then you have your sort.
  • Prefix with numbers or characters that make it sort the way you want.
  • Use two columns, one that sorts correctly and a "column built from other columns" that displays the text you want based on the first column's value.
chaley is offline   Reply With Quote