Class: FilterTree

FilterTree(id, filterTreeType)

A single filter tree. Is rendered on DOM elements with class 'boost-pfs-filter-tree' Auto-generate id on that DOM element with format 'boost-pfs-filter-tree-#'

Constructor

new FilterTree(id, filterTreeType)

Creates a new FilterTree
Parameters:
Name Type Description
id string Id of the DOM element where filter tree will be inserted
filterTreeType FilterTreeEnum 'vertical' or 'horizontal'
Source:

Extends

Members

children :Array

Array of child components
Type:
  • Array
Overrides:
Default Value:
  • []
Source:

parent :Component

The parent component
Type:
  • Component
Overrides:
Default Value:
  • null
Source:

Methods

_callAllBindEvents()

Bind events on the component (include all child-components)
Overrides:
Source:

_callAllInit()

Initialize the component (include all child-components)
Overrides:
Source:

_callAllRender()

Render the component (include all child-components)
Overrides:
Source:

addComponent(childComponent)

Add the child component into a component
Parameters:
Name Type Description
childComponent Object The child component
Overrides:
Source:

afterBindEvents()

After bind evnets on the component
Overrides:
Source:

afterInit()

After initialize callback
Overrides:
Source:

afterRender()

After reder component callback
Overrides:
Source:

beforeBindEvents()

Before bind events on component callback
Overrides:
Source:

beforeInit()

Before initialize callback
Overrides:
Source:

beforeRender()

Before reder component callback
Overrides:
Source:

bindEvents()

Bind events on the component
Overrides:
Source:

compileTemplate() → {string}

Replaces all brackets in raw template with values Replaces where other components should be with empty string
Source:
Returns:
- Compiled template
Type
string

getFooterTemplate() → {string}

Get the filter tree's html template for footer
Source:
Returns:
Raw footer html template
Type
string

getHeaderTemplate() → {string}

Get the filter tree's html template for header
Source:
Returns:
Raw header html template
Type
string

getTemplate() → {string}

Get the filter tree's html template. Depending on its filterTreeType, it returns different templates for 'vertical' and 'horizontal'
Source:
Returns:
Raw html template
Type
string

init()

Initialize component
Overrides:
Source:

isBindEvents()

Returns whether or not binding the events on a component
Overrides:
Source:

isLoopThroughChild()

Returns whether or not the childs of a component is refresh
Overrides:
Source:

isRender()

Returns whether or not the component is rendered
Overrides:
Source:

modifyOptionsData(options)

Modify the options list. For example: Change advance range slider display type, change multi level tag display type It modifies the option array in-place.
Parameters:
Name Type Description
options Array The data.options array.
Source:

onCloseFilterTree()

Hide the filter tree with a button inside the filter tree (the close button, not the mobile button)
Source:

onScreenResize()

Logic to re-render the filter tree on screen resize
Source:

refresh()

Refresh component
Overrides:
Source:

removeComponent(childComponent)

Remove a child component of a component
Parameters:
Name Type Description
childComponent Object The child component
Overrides:
Source:

render()

Render compoment
Overrides:
Source:

renderFull()

Render the full filter tree element. Called once on first load, and called when user filter by collection
Source:

renderPartially()

Re-render the fitler tree partially. Called whenever user performs filter, after first load.
Source:

renderRefineBy()

Renders the refine by block of filter tree
Source:

setData(data)

Set the filter data returned from API.
Parameters:
Name Type Description
data Object The data.filter field from the raw API data.
Source: