Closed
Description
This widget needs to be able to render this:
API
Given this html:
<div id="manufacturer"></div>
And this JavaScript:
instant.addWidget(
instantsearch.widgets.multipleChoiceList({
container: '#manufacturer',
facetName: 'manufacturer'
})
)
Default rendering output (no provided template):
<ul class="as--multipleChoiceList">
<li><label><input type="checkbox" value="Sony" checked />Sony <span>302</span></label></li>
<li><label><input type="checkbox" value="Microsoft" />Microsoft <span>120</span></label></li>
</ul>
<label>
is important to allow clicking on the "Sony" label rather than just the checkbox. This is also the standard way bootstrap advocates writing checkboxes.
I did not detail css classes but there should be css classes aroud elements for people to style them. Following #47?
Options
container
string or DOMElementfacetName
stringtemplate
string (hogan) or function
Available data when passing your own template
Template will be inserted <li>HERE</li>
value
stringcount
numberselected
boolean
Default sort
By default we can sort by name.
Once we are able to sort the facet values (algolia/algoliasearch-helper-js#178) then we can provide the option here.