Home > widget-integration > FilterRender > renderViewMore
FilterRender.renderViewMore() method
Renders the updated filter option values when view more is toggled.
Retrieves the current view more state, determines which values to display (limited or all), and re-renders the filter option using the appropriate template (list, box, or swatch).
Signature:
renderViewMore(filterOptionId: string, filterOptionDisplayType: string): Promise<void>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
filterOptionId |
string |
Unique identifier for the filter option |
|
filterOptionDisplayType |
string |
Display type (list/box/swatch) |
Returns:
Promise<void>
Remarks
This method is called by the view more button click handler and updates the button text between "View More" and "View Less".
Example
Override to add custom rendering logic:
async renderViewMore(filterOptionId, filterOptionDisplayType) {
await super.renderViewMore(filterOptionId, filterOptionDisplayType);
// Add custom animation
const container = document.querySelector(`[data-filter-option="${filterOptionId}"]`);
container?.classList.add('animate-expand');
}