Constructor
new SlickComplete(target, parametersopt)
Creates an instance of SlickComplete
and checks for invalid parameters
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
target |
Element | String | The input targeted by the SlickComplete module | ||||||||||||||||||||||||||||||||||||
parameters |
Object |
<optional> |
Additional optional parameters
Properties
|
- Source:
Members
value :String|Number
The currently selected item
Type:
- String | Number
- Source:
Methods
destroy()
Removes any SlickComplete mutation from the DOM
- Source:
find(value) → {SlickCompleteItem}
Finds the matching item for the user's query
Parameters:
Name | Type | Description |
---|---|---|
value |
String | String to search |
- Source:
Returns:
The matching item
- Type
- SlickCompleteItem
offPredict() → {SlickComplete}
Removes every callback previously added with SlickComplete#onPredict
- Source:
Returns:
The current SlickComplete
- Type
- SlickComplete
offSelect() → {SlickComplete}
Removes every callback previously added with SlickComplete#onSelect
- Source:
Returns:
The current SlickComplete
- Type
- SlickComplete
onPredict(callback) → {SlickComplete}
Adds a callback to be used when a precition is displayed
Parameters:
Name | Type | Description |
---|---|---|
callback |
onPredictCallback | Function to call after a prediction |
- Source:
Returns:
The current SlickComplete
- Type
- SlickComplete
onSelect(callback) → {SlickComplete}
Adds a callback to be used when the user selects an item
Parameters:
Name | Type | Description |
---|---|---|
callback |
onSelectCallback | Function to call after the user's selection |
- Source:
Returns:
The current SlickComplete
- Type
- SlickComplete
refresh() → {SlickComplete}
Refreshes the input's display
- Source:
Returns:
The current SlickComplete
- Type
- SlickComplete
select(itemId) → {SlickComplete}
Manually select an item
Parameters:
Name | Type | Description |
---|---|---|
itemId |
Object | The item to select |
- Source:
Returns:
The current SlickComplete
- Type
- SlickComplete
setItems(items) → {SlickComplete}
Set the items to search through
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
items |
Array.<Object> | Items to complete from
Properties
|
- Source:
Returns:
The current SlickComplete
- Type
- SlickComplete