Extends
- Backbone.View
Members
className
events
filterGroups :Array.<FilterGroup>
The FilterGroup models to display in this view
Type:
- Array.<FilterGroup>
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:
tagName
vertical :Boolean
If true, displays the FilterGroups in a vertical list
Type:
- Boolean
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 |
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 |
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 |
initialize()
removeAllFilters()
Gets all the applied filters in this view and their associated filter models
and removes them.
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 |
removeCustomAppliedFilter(filterModel)
Removes the custom applied filter from the UI.
Parameters:
Name | Type | Description |
---|---|---|
filterModel |
Filter | The Filter Model to display |
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
|
render()
renderAppliedFiltersSection()
Renders the section of the view that will display the currently-applied filters
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
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 |
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 |