Constructor
new DCFilter()
Example
Sample Usage -
Include the component in your template simply by adding c-dc-filter custom tag
<c-dc-filter></c-dc-filter>
KEY INFO -
events fired : "vlocity-dc-filter-list-updated"
events registered : "none"
Dependency - c-dc-filter is a component used for rendering and applying all the available filters.
It is commonly used as a child component for c-dc-offer-list but it can also be used as an independent component.
| Parent Component | Expected Child Component |
|------------------------------|------------------------------------------|
| c-dc-offer-list | none |
Sample with slots -
<c-dc-filter>
<span slot="{slot_name}">
Custom HTML elements goes here
</span>
</c-dc-filter>
List of available slots -
| Slot names | Dynamic | Description | Impact |
|-----------------------------|-------------|---------------------------------|----------------------------------------|
| dc-filter-wrapper | - | Wrapper for dc-filter | Replaces dc-filter |
| dc-filter-button | - | Wrapper for apply filter button | Replaces apply filter button |
| dc-filter-container | - | Wrapper for filter container | Replaces filter container |
| dc-filter-tags | - | Wrapper for applied filter tags | Replaces filter tags |
Extends
Members
(static) filterButtonClass
Method to get dynamic class name for filter button
(static) filterContainerClass
Method to get dynamic class name for filter container.
Methods
(static) filterSelected(selectedFilterId)
Method to toggle each filter.
Parameters:
Name | Type | Description |
---|---|---|
selectedFilterId |
string | Id of the current filter. |
(static) filterUpdate(event)
Method to update the current filter.
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | DOM Event |
(static) getSDKInstance()
Method to get digital commerce SDK instance.
(static) getTranslationLabels()
Method to get digital commerce translations.
(static) removeFilter(event)
Method to remove applied filter.
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | DOM Event. |
(static) toggleFilterContainer()
Method to toggle the filter container.
(static) updateFilterData(filterId, filterChecked)
Method to update filter data.
Parameters:
Name | Type | Description |
---|---|---|
filterId |
string | Id of the current filter. |
filterChecked |
boolean | Checked status of the current filter. |