Page History
...
No properties associated with the Filter object need to be accessed to utilise the API functionality.
Function Reference
getFilter(filterId)
Returns
Description
...
let filter = filters.get('47fe96c2-5101-4b0d-9018-7d12a84d3519'); |
getAllFilters()
Returns
Object - {String, FilterObject}
...
This function is useful for observing which filters are available in the FiltersAPI. If you are looking for a specific filter it is recommended using filters.getFilter(filterId) rather than getAllFilters()[uuid] as getFilters can accept a UUID or a name. If you wish to iterate over all filters, we recommend using filters.forEach(fn) instead.
forEach(fn)
Returns
Nothing.
Description
...
This would create a list of applied filter values with the filter's name and uuid also included in the object.
hasFilters()
Returns
Boolean
Description
...
if(filters.hasFilters()) { |
clearFilter(filterId)
Returns
Nothing.
Description
...
UUID or Name of the filter you wish to clear.
clear()
Returns
Nothing.
Description
Clears the values and applies the empty filter values in every FilterObject contained within the FiltersAPI.
applyFilters()
Returns
Nothing.
Description
...
document.querySelector('div#applyButton').addEventListener('click', function(e) { |
loadFilters()
Returns
Promise.
Description
Reloads filter data from the server. Promise is resolved once the filters have been loaded.
resetFiltersToDefault()
Returns
Nothing.
Description
...
filters.resetFiltersToDefault(); |
addEventListener(eventName, callbackFunction)
Returns
Number.
Description
...
let eventListenerId = filters.addEventListener('changed', function(event) { |
removeEventListener(listenerId)
Returns
Nothing.
Description
...
let eventListenerId = filters.addEventListener('changed', function(event) { |
trigger(eventName, eventData)
Returns
Nothing.
Description
...
- eventName - String - The name of the event that has been triggered.
- filterEvents - Array{Object} - An array of events that comprised this filter list change event. The object will contain at least the following.
- uuid - UUID of the filter that changed.
- filter - FilterObject that caused this event to trigger.
- Certain other filter events can contain more information. You can see the documentation in FilterObject for more in depth details on the Event object for each event.
changed
Description
Triggered when any of the FilterObjects within the FiltersAPI changes its staged values.
...
let filters = report.filters; |
applied
Description
Triggered when any of the filters within the FiltersAPI has different values applied to it. This happens when the user hits the apply button, or the applyFilters function is called.
...
let filters = report.filters; filters.applyFilters(); |
reset
Description
Triggered when any of the FilterObjects within the FiltersAPI are reset.
...
let filters = report.filters; |
cleared
Description
Triggered when any of the FilterObjects within the FiltersAPI are cleared.
...