Home > widget-integration > FilterRender > manageViewMoreState

FilterRender.manageViewMoreState() method

Manages view more state and rendering for filter options.

Controls the "View More" / "View Less" functionality that shows/hides additional filter values when there are many options. Updates state and re-renders the affected filter option with the appropriate number of values displayed.

Signature:

manageViewMoreState(params: {
		label: string;
		values: any[];
		swatchShape?: string;
		swatchType?: string;
		option: any;
		dom: HTMLElement;
		showDocCount?: boolean;
		selectedKeys: Record<string, boolean>;
		classNameSelected: string;
		classNameUnselected: string;
	}): Promise<void>;

Parameters

Parameter

Type

Description

params

{ label: string; values: any[]; swatchShape?: string; swatchType?: string; option: any; dom: HTMLElement; showDocCount?: boolean; selectedKeys: Record<string, boolean>; classNameSelected: string; classNameUnselected: string; }

View more configuration parameters

Returns:

Promise<void>

Remarks

This method initializes or updates the ViewMoreState in FilterStore and subscribes to VIEWMORE_TRIGGERED events for dynamic updates.

Example

Override to customize view more behavior:

async manageViewMoreState(params) {
  // Change default number of visible items
  const customParams = {
    ...params,
    option: {
      ...params.option,
      numberViewMore: this.getCustomViewMoreCount(params.option.filterType)
    }
  };
  return super.manageViewMoreState(customParams);
}