Home > widget-integration > FilterRender > optionList
FilterRender.optionList() method
Handles filter option list selection/deselection.
Main handler for list-style filter option clicks. Manages both single-select and multi-select filter types, updating state, URL parameters, and triggering API calls to refresh product results.
Signature:
optionList(action: {
key: string;
value: string;
filterType?: string;
selectType?: "single" | "multiple";
displayType?: string;
label?: string;
valueDisplay?: string;
handle?: string;
}): Promise<void>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
action |
{ key: string; value: string; filterType?: string; selectType?: "single" | "multiple"; displayType?: string; label?: string; valueDisplay?: string; handle?: string; } |
Filter option selection action |
Returns:
Promise<void>
Remarks
This method coordinates multiple operations: - Updates selectedFilter state - Modifies URL parameters - Triggers FILTER_RESET event for API call - Updates UI to show selection
Example
Override to add custom filter tracking:
async optionList(action) {
// Track filter selection
this.analytics.track('filter_selected', {
filterType: action.filterType,
value: action.value,
selectType: action.selectType
});
return super.optionList(action);
}