Class: SearchInput

SearchInput(id, $inputElement)

Search input compoment

Constructor

new SearchInput(id, $inputElement)

Parameters:
Name Type Description
id String The element ID if search input: boost-pfs-search-box-0, boost-pfs-search-box-1, ..., boost-pfs-search-box-n
$inputElement Object jQuery object of search input element
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

_bindAutoCompleteRenderMenu(ulElement, data)

Render the result menu for autocomplete
Parameters:
Name Type Description
ulElement Object The result menu element object
data Array The search result data
Source:

_bindAutoCompleteResizeMenu()

Bind the event when resize the result menu
Source:

_bindAutoCompleteResponse(event, autocompleteUi)

Bind autocomplete response
Parameters:
Name Type Description
event Event The ui-autocomplete event
autocompleteUi Object
Properties
Name Type Description
content Array List result data
Source:

_bindAutoCompleteSource(request, response)

Prepare source for Autocomplete event
Parameters:
Name Type Description
request Object A request object, with a single term property
response requestCallback The callback that handles the response
Source:

_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:

_onClickSearchBox(event)

Bind the click event on the search input
Parameters:
Name Type Description
event Event DOM event
Source:

_onFocusSearchBox(event)

Bind the focus event on the search input
Parameters:
Name Type Description
event Event DOM event
Source:

_onSubmit(event, redirect)

Bind the submit event on the search input
Parameters:
Name Type Description
event Event DOM event
redirect Boolean Set TRUE if want to redirect to search page / redirect page
Source:

_onTypeSearchBoxEvent(event)

Bind the typeahead event on the search input
Parameters:
Name Type Description
event Event DOM event
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 the events on search input
Overrides:
Source:

customizeInstantSearch()

Customize the result menu after resize; Use for customization
Source:

init()

Initialize the search input component
Overrides:
Source:

isBindEvents()

Returns whether or not the events are bind on search input
Overrides:
Source:

isLoopThroughChild()

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

isRender() → {boolean}

Returns whether or not the input component is rendered
Overrides:
Source:
Returns:
TRUE or FALSE
Type
boolean

onCloseAutocomplete(event, autocompleteUi)

Bind the close event on instant search result
Parameters:
Name Type Description
event * The ui-autocomplete event
autocompleteUi * The ui-autocomplete object
Source:

onFocusAutocomplete(event, autocompleteUi)

Bind the focus event on instant search result item
Parameters:
Name Type Description
event Event the ui-autocomplete event
autocompleteUi Object the ui-autocomplete object
Properties
Name Type Description
widget Object The result menu element
item Object The result item data
Source:

onOpenAutocomplete(event, autocompleteUi)

Bind the open event on instant search result
Parameters:
Name Type Description
event Event The ui-autocomplete event
autocompleteUi Object The ui-autocomplete object
Source:

onSelectAutocomplete(event, autocompleteUi)

Bind the select event on instant search result
Parameters:
Name Type Description
event Event The ui-autocomplete event
autocompleteUi Object The ui-autocomplete object
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() → {Object}

Render the search input
Overrides:
Source:
Returns:
jQuery object
Type
Object