VictorianResearchWeb / TheCurranIndex

Apache License 2.0
0 stars 1 forks source link

Implement typeahead/select box to manage thousands of authors #13

Open saracarl opened 7 years ago

tbl73 commented 7 years ago

My current thought is to use a type-ahead/ jQuery autocomplete functionality, so that you can type in the first few letters of the authors name and have options based on that. The select2 javascript library is another option if the jQuery-ui autocomplete widget doesn't work out.

tbl73 commented 7 years ago

After a bit of research, I think select2 might be easier to implement. You can acquire a list of the contributors included by the facet using map - for future reference, the code would be something like: <%[:contributors].each do |filter_name|%> <%filter = @search.filter(filter_name)%>

<% names = filter.facet.map {|facet_value| facet_value.entity}%> Then you can use "names" as the collection in the select box.