Class: FacetsUi

vef.search.FacetsUi(facetsTarget, selectedTarget, options)

Handling of defined and selected facets with an additional Ui Element. Listen to the "change" event to add it to the SearchRequest

Constructor

new FacetsUi(facetsTarget, selectedTarget, options)

options = { facetTitle: "

{title}

", facetTemplate: "
  • {label} ({value})
  • ", selectTemplate: "
  • {label} X
  • " }
    Parameters:
    Name Type Description
    facetsTarget string | HTMLElement
    selectedTarget string | HTMLElement
    options object
    Author:
    Source:

    Methods

    defineFacet(path, title)

    Defines the given title for the given path. This is useful for root facet entries.
    Parameters:
    Name Type Description
    path string
    title string
    Source:

    deselectFacet(path, triggerEvents)

    Removes the facet identified by path from selected facets.
    Parameters:
    Name Type Description
    path string | object path or facet
    triggerEvents boolean default=true
    Source:

    selectFacet(path, triggerEvents)

    Selects a facet for restriction.
    Parameters:
    Name Type Description
    path string
    triggerEvents boolean default=true
    Source:

    setAvailableFacets(facets)

    Sets all available facets.
    Parameters:
    Name Type Description
    facets Object
    Source: