jsdoc

$.ui.simplicityFacetedSelect

Namespace $.ui.simplicityFacetedSelect

Dynamically populates the option elements in a select based on the facet response from the controller.

Listens to simplicitySearchResponse events and uses the facet output to update the available option elements in the wrapped select.

Has special support for handling option elements with no value.
Defined in: ui.simplicityFacetedSelect.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
$.ui.simplicityFacetedSelect.options
Widget options.
Method Summary
Method Attributes Method Name and Description
<private> <static>  
$.ui.simplicityFacetedSelect._searchResponseHandler()
Event handler for the simplicitySearchResponse event.
<private> <static>  
$.ui.simplicityFacetedSelect._setOption()
Override of _setOption that is used to ensure that the nextResponseOnly option works as expected when changed.
<private> <static>  
$.ui.simplicityFacetedSelect.refresh(ui)
Recreates the option elements in the wrapped select taking care to preserve the current selection.
Namespace Detail
$.ui.simplicityFacetedSelect
  <select id="category" name="cat">
    <option value="">Select...</option>
  <select>
  <script type="text/javascript">
    $('#category').simplicityFacetedSelect();
  </script>
Field Detail
<static> $.ui.simplicityFacetedSelect.options
Widget options.
facetsKey
The key used in the facets request to identify the facets data. Defaults to the name attribute of the select element.
searchElement
The location of the simplicityDiscoverySearch widget. Defaults to 'body'.
optionTemplate
Template used when optionFormatter is not set. Bracketed text will be replaced by it's mapped value, unknown variables and other text will remain as is. Defaults to '{option}'.

Supported substitutions:

{option}
The label for the facet. If no label is available then this is the id.
{count}
The count for the facet, if available. If not available defaults to the value of the missingCount option.
missingCount
Used during template substitution for facets that have no count. Defaults to '?'.
optionFormatter
Optional callback function that can be used to customize the label for each facet. Gets called with a single argument that is a dictionary containing id and facet entries. The facet entry consists of the returned data for the facet from the simplicitySearchResponse event.
indent
If set to a non-empty string, then this will be used as a leading indentation for each level of descendant facets. Note that actual whitespace characters are not rendered by most browsers. Setting to an empty string results in no indentation being applied for descendant facets. Defaults to ''.
maxDepth
Option to control the maximum tree depth displayed. Setting this to a positive number causes the maximum depth to be that value. Setting this to -1 makes the maximum depth unlimited and setting it to 0 causes no facets to be added.
nextResponseOnly
Option that causes the dynamic option population to trigger for the next simplicitySearchResponse event that contains facet data for the configured facet. Defaults to false.
firstPathOnly
Option that causes the dynamic option population to follow only the first selected path through the hierarchy of available facets. Defaults to false.
Method Detail
<private> <static> $.ui.simplicityFacetedSelect._searchResponseHandler()
Event handler for the simplicitySearchResponse event. Calls refresh while respecting the nextResponseOnly option.

<private> <static> $.ui.simplicityFacetedSelect._setOption()
Override of _setOption that is used to ensure that the nextResponseOnly option works as expected when changed.

<private> <static> $.ui.simplicityFacetedSelect.refresh(ui)
Recreates the option elements in the wrapped select taking care to preserve the current selection.
Parameters:
ui
The simplicitySearchResponse payload.

Documentation generated by JsDoc Toolkit 2.4.0