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

If a group, wrap in its own DIV or UL #179

Closed
damianstrain opened this Issue Apr 8, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@damianstrain

damianstrain commented Apr 8, 2016

Hi, great library! This is more of a tweak I think... If I have two groups:

source: {
entities: {
template: "{{primary}}",
display: ["primary", "secondary"],
url: ["/i/" + entityData.leid + "/search/all", "data.entities"]
},
users: {
template: "{{primary}}",
display: ["primary", "secondary"],
url: ["/i/" + entityData.leid + "/search/all", "data.users"]
}
}

Would it be possible to have it so that each group is wrapped in its own DIV or UL? Or perhaps have it as an option like "wrapGroups: true". This would make it easier for multi-column search result panes.

Thanks

@tgmweb

This comment has been minimized.

tgmweb commented Apr 8, 2016

+1 for this.

Perhaps:

group: {
    template: "<div id='groupheader'>{{group}}</div> {{groupresults}} <div id='groupfooter'></div>"
}
@running-coder

This comment has been minimized.

Owner

running-coder commented Apr 8, 2016

Hey Pixel, possibly something like #69?

@damianstrain

This comment has been minimized.

damianstrain commented Apr 8, 2016

Yes like that....Apologies, I can't believe I didn't see that open item lol :)

@tgmweb

This comment has been minimized.

tgmweb commented Apr 8, 2016

That's exactly what I'm looking to do too. WHen you have 5 groups and 10-15 items per group the dropdown get's huge :)

On another note, is there a way to limit maxItem per group? At present it seems to limit all items - so if I want a max of 10 per group I'm having to do that in source.url.callback...

@running-coder

This comment has been minimized.

Owner

running-coder commented Apr 8, 2016

for the maxItemPerGroup you can check beer_v1 demo

@running-coder

This comment has been minimized.

Owner

running-coder commented Apr 8, 2016

@pixelpop This feature is next on the list ;)

@running-coder running-coder added this to the 2.6.0 milestone Apr 8, 2016

running-coder pushed a commit that referenced this issue Apr 13, 2016

@running-coder

This comment has been minimized.

Owner

running-coder commented Apr 13, 2016

I'll close this one, you can refer to the original ticket #69 to follow the status, thx

running-coder added a commit that referenced this issue Apr 22, 2016

Version 2.6.0
*Breaking change*
- Update Typeahead source option: source.group.url.url has been replaced by source.group.ajax.url

Features
- #69, #179 Added groupTemplate option
- #183 Allow Typeahead to search for deep source object keys

Fixes
- #149 Support for Mobiles
- #181 IE8 incompatibility
- #182 Fixed double form submit when the "Enter" key is pressed & fixed JS error when searching for an undefined or numeric value
- #184 Invalid encoded characters on dynamic requests for `{{query}}`

Notes
- Reworked the source.group options, url has been replaced by ajax
- Removed the source.group.ignore option, use source.group.filter instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment