Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Sort by two number fields #19

Closed
Jayshua opened this issue Apr 25, 2019 · 1 comment
Closed

Sort by two number fields #19

Jayshua opened this issue Apr 25, 2019 · 1 comment
Assignees
Labels
help wanted Extra attention is needed wontfix This will not be worked on

Comments

@Jayshua
Copy link

Jayshua commented Apr 25, 2019

I have some pages that represent articles. Each article has a volume and a number. (For example: Volume 1, Number 10. Volume 12, Number 3.) I need to be able to sort (and hopefully search) by both the volume and number.

So far the best I could come up with was something like this:
image

I need to pad the volume/number with a zero so that they sort correctly. Otherwise it puts Volume 10 before Volume 2.

If I put the volume in one column and the number in the other I can sort correctly by volume but the number column is randomly sorted which kind of defeats the purpose.

Ideally I wouldn't need to pad the numbers to get them to sort correctly. Also, this makes it difficult to search by volume and number since you have to pad the digits in the search field too. Is there an easy way to solve this?

@sylvainjule sylvainjule self-assigned this Jun 13, 2019
@sylvainjule
Copy link
Owner

Hello, I've came back a few times to this issue, every time trying to figure out how to do this in a simple way.

Combining multiple sortings would add a lot of complexity in the code (so a plugin harder to maintain), for a very specific use-case. I won't fix unless someone comes up with something dead simple.

In your situation, I would sort the whole section with the sort blueprint param:

mypagetables:
  type: pagetable
  sortBy: volume asc number asc

@sylvainjule sylvainjule added help wanted Extra attention is needed wontfix This will not be worked on labels Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants