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 |
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 |
_bindAutoCompleteResizeMenu()
Bind the event when resize the result menu
_bindAutoCompleteResponse(event, autocompleteUi)
Bind autocomplete response
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
event |
Event | The ui-autocomplete event | ||||||
autocompleteUi |
Object |
Properties
|
_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 |
_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 |
_onFocusSearchBox(event)
Bind the focus event on the search input
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | DOM event |
_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 |
_onTypeSearchBoxEvent(event)
Bind the typeahead event on the search input
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | DOM event |
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
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 |
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
|
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 |
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 |
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