Class: FilterGroupsView

FilterGroupsView()

Creates a view of one or more FilterGroupViews

Constructor

new FilterGroupsView()

Source:

Extends

  • Backbone.View

Members

className

Source:

collapsible :boolean

If set to true, then all filters within this group will be collapsible. See FilterView#collapsible
Type:
  • boolean
Since:
  • 2.25.0
Default Value:
  • false
Source:

edit :boolean

Set to true to render this view as a FilterGroups editor; allow the user add, edit, and remove FilterGroups (TODO), and to add, delete, and edit filters within groups.
Type:
  • boolean
Since:
  • 2.17.0
Source:

editorView :PortalEditorView

A reference to the PortalEditorView
Type:
Source:

events

Source:

filterGroups :Array.<FilterGroup>

The FilterGroup models to display in this view
Type:
Source:

filters :Filters

The Filters Collection that contains the same Filter models from each FilterGroup and any additional Filter Models that may not be in FilterGroups because they're not displayed or applied behind the scenes.
Type:
Source:

initialQuery :string

The initial query to use when the view is first rendered. This is a text value that will be set on the general `text` Solr field.
Type:
  • string
Since:
  • 2.25.0
Source:

tagName

Source:

template

The template for this view. An HTML file is converted to an Underscore.js template
Since:
  • 2.17.0
Source:

vertical :Boolean

If true, displays the FilterGroups in a vertical list
Type:
  • Boolean
Source:

Methods

addCustomAppliedFilter(filterModel)

Adds a custom filter that likely exists outside of the FilterGroups but needs to be displayed with these other applied fitlers.
Parameters:
Name Type Description
filterModel Filter The Filter Model to display
Source:

createAppliedFilter(filterModel, value) → {jQuery}

Creates a single applied filter element and returns it. Filters can have multiple values, so one value is passed to this function at a time.
Parameters:
Name Type Description
filterModel Filter The Filter model that is being added to the display
value string | number | Boolean The new value set on the Filter model that is displayed in this applied filter
Source:
Returns:
- The complete applied filter element
Type
jQuery

handleRemove()

When a remove button is clicked, get the filter model associated with it /* and remove the filter from the filter group
Parameters:
Type Description
Event The DOM Event that occured on the filter remove icon
Source:

initialize()

Source:

removeAllFilters()

Gets all the applied filters in this view and their associated filter models and removes them.
Source:

removeAppliedFilterElByModel()

Remove the applied filter element for the given model This only removed the element from the page, it doesn't update the model at all or trigger any events.
Parameters:
Type Description
Filter The Filter model whose elements will be deleted
Source:

removeCustomAppliedFilter(filterModel)

Removes the custom applied filter from the UI.
Parameters:
Name Type Description
filterModel Filter The Filter Model to display
Source:

removeFilter(filterModel, appliedFilterEl, options)

Remove the filter from the UI and the Search collection
Parameters:
Name Type Description
filterModel Filter The Filter to remove from the Filters collection
appliedFilterEl Element The DOM Element for the applied filter on the page
options object Additional options for this function
Properties
Name Type Description
removeSilently boolean If true, the Filter model will be removed siltently from the Filters collection. This is useful when removing multiple Filters at once, and triggering a remove/change/reset event after all have been removed.
Source:

render()

Source:

renderAllFilter(searchFor)

Renders an "All" filter that will search the general `text` Solr field
Parameters:
Name Type Description
searchFor string The initial value of the "All" filter. This will get set on the filter model and trigger a change event. Optional.
Source:

renderAppliedFiltersSection()

Renders the section of the view that will display the currently-applied filters
Source:

toggleAppliedFiltersHeader()

Hides or shows the applied filter list title/header, as well as the help message that lets the user know they can add filters when there are none
Source:

updateAppliedFilters(filterModel, options)

Renders the values of the given Filter Model in the current filter model
Parameters:
Name Type Description
filterModel Filter The FilterModel to display
options object Additional options for this function
Properties:
Name Type Description
options.displayWithoutChanges boolean If true, this filter will display even if the value hasn't been changed
Source:

updateAppliedRangeFilters(filterModel, optionsopt)

When a NumericFilter or DateFilter model is changed, update the applied filters in the UI
Parameters:
Name Type Attributes Description
filterModel DateFilter | NumericFilter The model whose values to display
options object <optional>
Additional options for this function
Properties:
Name Type Attributes Description
options.displayWithoutChanges boolean <optional>
If true, this filter will display even if the value hasn't been changed
Source: