Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non Alphabetical Order #12

Open
The-Code-Monkey opened this issue Feb 6, 2018 · 1 comment
Open

Non Alphabetical Order #12

The-Code-Monkey opened this issue Feb 6, 2018 · 1 comment

Comments

@The-Code-Monkey
Copy link

I cant seem to get is to go non alphabetically why doesn't it just put them in the order they have them in the array would make it so much nicer especially when you are doing a month of the year dropdown would make it nicer to have them in the correct order without having to add the month number at the start. Is there an easy built in way that I am missing?

@trevorr
Copy link
Collaborator

trevorr commented Feb 11, 2018

You could specify your own ItemAdapter that overrides sortItems to do nothing. The default implementation performs sorting based on the current search value, which enables features like relevance sorting. Unfortunately, since Array.sort is not guaranteed to be stable, you can't easily leave equally-relevant items in the original order. Another option (which I have used myself) is just adding a consecutive integer sort key (named sortKey by default) to each item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants