jsdoc

$.ui.simplicityFacetCount

Namespace $.ui.simplicityFacetCount

Displays a single facet count based on the search results. Listens for simplicitySearchResponse events and updates element HTML with a templatized facet count. Also supports injecting the facet count into a select input.

This widget is generally used as a building block, you probably want to use simplicityFacetedInput directly.
Defined in: ui.simplicityFacetCount.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
$.ui.simplicityFacetCount.options
Widget options.
Method Summary
Method Attributes Method Name and Description
<private> <static>  
$.ui.simplicityFacetCount._searchResponseHandler()
Event handler for the simplicitySearchResponse event.
<static>  
$.ui.simplicityFacetCount.numberFormatter(count)
Format a face count value.
Namespace Detail
$.ui.simplicityFacetCount
  <select id="size" name="size">
    <option value="small">Small</option>
    <option value="medium">Medium</option>
    <option value="large">Large</option>
  </select>
  <script type="text/javascript">
    $('#size option[value="small"]').simplicityFacetCount({
      dimension: 'Size',
      facetId: 'S'
    });
    // etc.
  </script>
  <input type="checkbox" id="large" name="size" value="large" />
  <label for="large">Large (<span id="largeCount"></span>)</label>
  <script type="text/javascript">
    $('#largeCount').simplicityFacetCount({
      dimension: 'Size',
      facetId: 'L'
    });
  </script>
Field Detail
<static> $.ui.simplicityFacetCount.options
Widget options.
searchElement
The location of the simplicityDiscoverySearch widget. Defaults to 'body'.
missingCount
Text to use when there is no associated facet count. Defaults to '?'.
dimension
Mandatory dimension from which the facet counts should be used.
facetsKey
The key used in the facets request to identify the facets data. Defaults to dimension.
facetId
Mandatory id of the facet whose count should be bound to this widget.
optionTemplate
Template used when bound to an option element. Defaults to '{option} {count}'. Bracketed text will be replaced by the option value and any formatted count respectively. Other text not included in the bracketed fields will be left as-is. Applies only to facet counts for OPTION tags.
numberFormatter
Optional function that can be called with the facet count and is expected to return a string.
Method Detail
<private> <static> $.ui.simplicityFacetCount._searchResponseHandler()
Event handler for the simplicitySearchResponse event. Extracts the configured facet count and displays it.

<static> $.ui.simplicityFacetCount.numberFormatter(count)
Format a face count value. Returning the facet count as a formatted string.
  <select id="size" name="size">
    <option value="small">Small</option>
    <option value="medium">Medium</option>
    <option value="large">Large</option>
  </select>
  <script type="text/javascript">
    $('#size option[value="small"]').simplicityFacetCount({
      dimension: 'Size',
      facetId: 'S',
      numberFormatter: function(count) {
       return "(" + count + ")";
      }
    });
    // etc.
  </script>
Parameters:
count
The facet count to format

Documentation generated by JsDoc Toolkit 2.4.0