Page History
Table of Contents | ||||
---|---|---|---|---|
|
Filter Object
...
let filter = filters.getFilter('Average Age at Camp'); |
appliedValueTwo
Returns
String or Number.
Description
...
let eventListenerId = filters.addEventListener('changed', function(event) { |
trigger(eventName, eventData)
Returns
Nothing.
Description
...
filter.addEventListener('changed', function(event) { |
changed
Description
Occurs when any of the filter values changes. Triggers with an object that contains the values that changed as well as the previous values of all of those values.
Parameters
Event - Object
Contains:
- uuid - String - UUID of the filter that triggered the event.
- filter - FilterObject - FilterObject of the filter that triggered the event.
- changed - Object - Object containing any values that have changed. Could possibly contain valueOne, valueTwo or valueList.
- Previous - Object - Object containing the old values of all of the changed values. Could possibly contain valueOne, valueTwo or valueList.
Example
filter.addEventListener('applied', function(event) { |
applied
Description
Occurs when the filter is applied to the linked piece of content (report/dashboard). And the applied values change.
Parameters
Event - Object
Contains:
- uuid - String - UUID of the filter that triggered the event.
- filter - FilterObject - FilterObject of the filter that triggered the event.
- changed - Object - Object containing any values that have changed. Could possibly contain valueOne, valueTwo or valueList.
- Previous - Object - Object containing the old values of all of the changed values. Could possibly contain valueOne, valueTwo or valueList.
Example
filter.addEventListener('applied', function(event) { |
Notes/Limitations
The applied event may be triggered in a case like this:
let filter = filters.getFilter('Demographic'); |
Due to the code creating a new Array when calling setValue. So any comparison that occurs will be of Array to Array.
The correct values will still be applied to the report.
reset
Description
Occurs when the reset function is called on the filter. This can occur from user interaction, clicking the reset button on a filter menu, or by a developer explicitly calling it.
Example
filter.addEventListener('reset', function(event) { |
Parameters
Event - Object
Contains:
- uuid - String - UUID of the filter that triggered the event.
- filter - FilterObject - FilterObject of the filter that triggered the event.
cleared
Description
Occurs when the clear function is called on the filter. This can occur from user interaction, or by a developer explicitly calling it.
Difference between cleared and reset
Resetting a filter resets it to its default values. Where as clearing a filter will set it to have no values.
Parameters
Event - Object
Contains:
- uuid - String - UUID of the filter that triggered the event.
- filter - FilterObject - FilterObject of the filter that triggered the event.
Example
filter.addEventListener(cleared, function(event) { |