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

Can I order group layout? #95

Closed
sdillinger opened this Issue Oct 22, 2015 · 9 comments

Comments

Projects
None yet
2 participants
@sdillinger

sdillinger commented Oct 22, 2015

Hi,

Other than reworking the resultHtml, is there a way to order the grouping in the result dropdown?

In my use case there are two group - 'available' and 'not available'. I need to show both (long story), but the user will attempt to match against the available group, so I need that one on top.

I'm grouping by an object key.

Hopefully what I am asking makes sense.

Thanks.

@sdillinger

This comment has been minimized.

sdillinger commented Oct 22, 2015

it's easy to do this with resultHtml, so just asking out of curiosity...

@running-coder

This comment has been minimized.

Owner

running-coder commented Oct 22, 2015

Perhaps related to #76 ?

@sdillinger

This comment has been minimized.

sdillinger commented Oct 22, 2015

Yes that's it... any chance you can merge it in?

@running-coder

This comment has been minimized.

Owner

running-coder commented Oct 22, 2015

Yea, but I want to also take time to maybe build it as a callback or a function so it would be possible to control the ordering based on custom conditions, for example put the group that has the most matched element on top.

@running-coder running-coder added this to the 2.1.4 milestone Oct 22, 2015

@sdillinger

This comment has been minimized.

sdillinger commented Oct 22, 2015

Ok.. Thanks... I realized that since I control the server json creation I
could just order it there, which seems to work.

Having said that I still think it would be a useful feature.

On Thu, Oct 22, 2015 at 3:58 PM, Tom Bertrand notifications@github.com
wrote:

Yea, but I want to also take time to maybe build it as a callback or a
function so it is possible to control the ordering based on your custom
conditions.


Reply to this email directly or view it on GitHub
#95 (comment)
.

Steve Dillinger
Founder & CEO

CIQ Labs - ClassroomIQ
222 Merchandise Mart Plaza
Suite 1212
Chicago, IL 60654

steve@ciqlabs.com
(312) 804-4799

www.getclassroomiq.com http://www.classroom-iq.com

@sdillinger

This comment has been minimized.

sdillinger commented Oct 22, 2015

I take that back. When I change the group of a source item it blows up the order again.

Thanks for slotting it into 2.1.4

@running-coder running-coder modified the milestones: 2.2.0, 2.1.4 Oct 27, 2015

running-coder pushed a commit that referenced this issue 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 sdillinger, lmk if the feature behave properly (develop branch for now, will release the tag later tonight / tomorrow)

Thanks

@running-coder

This comment has been minimized.

Owner

running-coder commented Nov 5, 2015

By default, the groups will be output in the same order as they are defined in options.source
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

@sdillinger

This comment has been minimized.

sdillinger commented Nov 6, 2015

I think this looks good. Thanks!

running-coder pushed a commit that referenced this issue 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 issue 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