Skip to content

Commit

Permalink
doc(connectRefinementList): fix live example
Browse files Browse the repository at this point in the history
  • Loading branch information
iam4x committed May 15, 2017
1 parent 5ef35a1 commit 0442bdc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/connectors/refinement-list/connectRefinementList.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ export const checkUsage = ({attributeName, operator, usageMessage, showMoreLimit
*
* if (RefinementListRenderingOptions.canRefine) {
* var list = RefinementListRenderingOptions.items.map(function(item) {
* return '<li data-refine-value="' + item.value + '">' +
* '<input type="checkbox" value="' + item.value + '"' + item.isRefined ? ' checked' : '' + '/>' +
* '<a href="' + RefinementListRenderingOptions.createURL(item.value) + '">' + item.label + '</a>' +
* '</li>';
* return `
* <li data-refine-value="${item.value}">
* <input type="checkbox" value="${item.value}" ${item.isRefined ? 'checked' : ''} />
* <a href="${RefinementListRenderingOptions.createURL(item.value)}">
* ${item.label} (${item.count})
* </a>
* </li>
* `;
* });
*
* RefinementListRenderingOptions.widgetParams.containerNode.find('ul').html(list);
Expand All @@ -113,6 +117,7 @@ export const checkUsage = ({attributeName, operator, usageMessage, showMoreLimit
* } else {
* RefinementListRenderingOptions.widgetParams.containerNode.find('ul').html('');
* }
* }
*
* // connect `renderFn` to RefinementList logic
* var customRefinementList = instantsearch.connectors.connectRefinementList(renderFn);
Expand All @@ -122,6 +127,7 @@ export const checkUsage = ({attributeName, operator, usageMessage, showMoreLimit
* customRefinementList({
* containerNode: $('#custom-refinement-list-container'),
* attributeName: 'categories',
* limit: 10,
* })
* );
*/
Expand Down

0 comments on commit 0442bdc

Please sign in to comment.