-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Group by categories #11
Comments
The results are grouped by dataset. Maybe we need two templates: one for each result and one for each dataset (category) of results |
Custom grouping would be nice to add, would have to support an optional category attribute in the datum object. |
The datasets would be the categories. |
The changes I made in #15 make something like this pretty easy. We could add <div class="tt-dropdown-menu">
{{#dataset}}
<div class="tt-dataset-{{name}}">
<!-- HEADER GOES HERE -->
<div class="tt-suggestions">
{{#suggestions}}
<div class="tt-suggestion">{{{html}}}<div>
{{/suggestions}}
</div>
<!-- FOOTER GOES HERE -->
{{/dataset}}
</div> I don't really see any downside to this and I could have it ready to go for v0.9. @keithslater would this solve your issue? |
What if the multiple datasets point to the same remote url (as twitter does with https://twitter.com/i/search/typeahead.json?count=10&q=%QUERY)? I'm having troubles in this case, because the _processRemoteSuggestions method, is not able to parse categories, it's made only for non-multidimensional array responses, or strings. I want to be able to parse a JSON response like { topics: [...], users: [...] } Do you know if is there a workaround for this? |
Supporting something like this is definitely on the roadmap. You should be able to handle this scenario in v0.9 in a roundabout way and in a later version the hope is to add seamless support for it. |
I'm working on a fix by doing
and
It works, but transporter only calls _processRemoteSuggestions once, need deeper chances I guess. If I get to fix it, will create a pull request. |
In which file should this be added?
|
Anyway to group results by categories? It would be nice to show the category name and list the items below it.
The text was updated successfully, but these errors were encountered: