"Selects" an item.
"Selects" an item. Adds it to the list at the current caret position.
"Selects" multiple items at once.
"Selects" multiple items at once. Adds them to the list at the current caret position.
Adds an available option.
Adds an available option. If it already exists,
nothing will happen. Note: this does not refresh
the options list dropdown (use refreshOptions
for that).
Usage:
this.addOption(data)
Moves the caret left / right.
Selects the previous / next item (depending
on the direction
argument).
Selects the previous / next item (depending
on the direction
argument).
> 0 - right < 0 - left
Determines whether or not to display the create item prompt, given a user input.
Determines whether or not to display the create item prompt, given a user input.
{boolean}
Resets / clears all selected items from the control.
Clears the render cache for a template.
Clears the render cache for a template. If no template is given, clears all render caches.
Clears all options.
Closes the autocomplete dropdown menu.
Invokes the create
method provided in the
selectize options that should provide the data
for the new item, given the user input.
Invokes the create
method provided in the
selectize options that should provide the data
for the new item, given the user input.
Once this completes, it will be added to the item list.
{boolean}
Removes the current selected item(s).
Completely destroys the control and unbinds all event listeners so that it can be garbage collected.
Disables user input on the control completely.
Disables user input on the control completely. While disabled, it cannot receive focus.
Enables the control so that it can respond to focus and user input.
Returns the jQuery element of the next or previous selectable option.
Returns the jQuery element of the next or previous selectable option.
{object}
Finds the first element with a "data-value" attribute that matches the given value.
Finds the first element with a "data-value" attribute that matches the given value.
{object}
Returns the jQuery element of the item matching the given value.
Returns the jQuery element of the option matching the given value.
A helper method for inserting an element at the current caret position.
Determines whether or not more items can be added to the control without exceeding the user-defined maximum.
Invokes the provided method that provides results to a callback---which are then added as options to the control.
Shows the autocomplete dropdown containing the available options.
Calculates and applies the appropriate position of the dropdown.
Updates all state-dependent CSS classes.
Re-renders the selected item lists.
Refreshes the list of available options shown in the autocomplete dropdown menu.
Updates all state-dependent attributes and CSS classes.
Removes the selected item matching the provided value.
Removes a single option.
A helper method for rendering "item" and "option" templates, given the data.
Searches through available options and returns a sorted array of matches.
Searches through available options and returns a sorted array of matches.
Returns an object containing:
Moves the caret to the specified index.
Sets the input field of the control to the specified value.
Updates an option available for selection.
Updates an option available for selection. If it is visible in the selected items or options dropdown, it will be re-rendered automatically.
Refreshes the original
Refreshes the original
Shows/hide the input placeholder depending on if there items in the list already.