Suggestions plugin allows to easily specify the list of suggestion items that the Autocomplete plugin would present to the user.



Suggestions plugin only has one option and that is to set suggestion items. It could be changed when passed to the $().textext() function. For example:

    plugins: 'suggestions',
    suggestions: [ "item1", "item2" ]

suggestions (null)

List of items that Autocomplete plugin would display in the dropdown.


Suggestions plugin dispatches or reacts to the following events.


Suggestions plugin reacts to the getSuggestions event and returns suggestions items from the options.


Suggestions plugin reacts to the postInit event to pass its list of suggestions to the Autocomplete right away.


Suggestions plugin triggers the setSuggestions event to pass its own list of Suggestions to the Autocomplete plugin.



  • core {TextExt} Instance of the TextExt core class.

Initialization method called by the core during plugin instantiation.

TextExtSuggestions.onGetSuggestions(e, data)

  • e {Object} jQuery event.

  • data {Object} Payload from the getSuggestions event with the user query, eg { query: {String} }.

Reacts to the getSuggestions event and triggers setSuggestions event with the list of suggestions specified in the options.


  • e {Object} jQuery event.

Reacts to the postInit event and triggers setSuggestions event to set suggestions list right after initialization.

TextExtSuggestions.setSuggestions(suggestions, showHideDropdown)

  • suggestions {Array} List of suggestions. With the default ItemManager it should be a list of strings.

  • showHideDropdown {Boolean} If it’s undesirable to show the dropdown right after suggestions are set, false should be passed for this argument.

Triggers setSuggestions and passes supplied suggestions to the Autocomplete plugin.

Fork me on GitHub