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

sort results on specific key #76

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@benoit-ponsero

benoit-ponsero commented Sep 10, 2015

Useful when you have many sources and you want to sort some group before others.

Sorry for precedent pull request, it appears that Github quick edit seems buggy

@running-coder

This comment has been minimized.

running-coder commented on 18b60cb Oct 27, 2015

Hi benoit, I wanted to merge the change but I'm asking myself what would be a use-case where you don't want the first display key to be the ordering key?

This comment has been minimized.

Owner

benoit-ponsero replied Oct 27, 2015

like www.hotelissima.fr, we have 3 groups and want to display the name.
We want to display the 3 groups always in the same order. If we order only by display the 3 group are sorted in the order of the first item of the group.

running-coder pushed a commit that referenced this pull request Nov 5, 2015

tom bertrand
#76, #95 Added `options.groupOrder` option to specify the group order…
… via "asc", "desc", Array or function that returns an Array.
@running-coder

This comment has been minimized.

Owner

running-coder commented Nov 5, 2015

Hey benoit, I've added an option called groupOrder to specify the order the groups should appear. I've fixed the issue where they wouldn't appear by the order you declare them in the source by default.

It is currently available in the develop branch so you might want to have a look. Documentation website should be updated soon but here are the things you can set it to.

Set "asc" or "desc" to have the group name sorted ascending or descending
Set an Array to specify the group order to appear in the search result
Set a Function that returns an Array

thanks.

running-coder pushed a commit that referenced this pull request Nov 10, 2015

tom bertrand
Version 2.2.0
#76, #95 Added groupOrder option
#80 Option to use a function to resolve group label
#90 options.cache< now accepts "true", "localStorage" or "sessionStorage"
#102 Add UMD wrapper

Fixes
#101 Uncaught TypeError: this.xhr[i].abort is not a function
#103 Typo in dropdownCarret option, now dropdownCaret

running-coder pushed a commit that referenced this pull request Nov 10, 2015

tom bertrand
Version 2.2.0
#76, #95 Added groupOrder option
#80 Option to use a function to resolve group label
#90 options.cache< now accepts "true", "localStorage" or "sessionStorage"
#102 Add UMD wrapper

Fixes
#101 Uncaught TypeError: this.xhr[i].abort is not a function
#103 Typo in dropdownCarret option, now dropdownCaret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment