core/form-autocomplete

Autocomplete wrapper for select2 library.

Source:
Since:
  • 3.0
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(inner) KEYS :Object

Source:

List of keycode constants.

Type:
  • Object

Methods

(inner) enhance(selector, tags, ajax, placeholder, caseSensitive, showSuggestions, noSelectionString, closeSuggestionsOnSelect, templateOverrides) → {Promise}

Source:

Turn a boring select box into an auto-complete beast.

Parameters:
Name Type Description
selector string

The selector that identifies the select box.

tags boolean

Whether to allow support for tags (can define new entries).

ajax string

Name of an AMD module to handle ajax requests. If specified, the AMD module must expose 2 functions "transport" and "processResults". These are modeled on Select2 see: https://select2.github.io/options.html#ajax

placeholder String

The text to display before a selection is made.

caseSensitive Boolean

If search has to be made case sensitive.

showSuggestions Boolean

If suggestions should be shown

noSelectionString String

Text to display when there is no selection

closeSuggestionsOnSelect Boolean

Whether to close the suggestions immediately after making a selection.

templateOverrides Object

A set of templates to use instead of the standard templates

Returns:
Type
Promise