Home > widget-integration > FilterRender > renderOptionMultiLevelCollection
FilterRender.renderOptionMultiLevelCollection() method
Renders multi-level collection filter with hierarchical structure.
Generates HTML for nested collection filters that support parent-child relationships. Includes expand/collapse controls for subcollections.
Signature:
renderOptionMultiLevelCollection(params: {
option: any;
dom: HTMLElement;
limit?: number;
lazyLoad?: boolean;
viewportId?: string;
}): Promise<void>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
params |
{ option: any; dom: HTMLElement; limit?: number; lazyLoad?: boolean; viewportId?: string; } |
Multi-level collection rendering parameters |
Returns:
Promise<void>
Remarks
This method recursively renders subcollections and manages their expand/collapse state. Override to customize collection hierarchy display.
Example
Override to add collection icons:
async renderOptionMultiLevelCollection(params) {
await super.renderOptionMultiLevelCollection(params);
// Add collection icons
params.dom.querySelectorAll('.collection-item').forEach(item => {
const handle = item.getAttribute('data-handle');
const icon = this.getCollectionIcon(handle);
item.insertAdjacentHTML('afterbegin', `<img src="${icon}" class="col-icon"/>`);
});
}