Categories

.remotesearchUiSuggest()

Categories: UI

.remotesearchUiSuggest( [ options ] )

Subclass: de_epages

Inherit: (Subclass: de_epages) .widget()

Plugin: de_epages.remotesearch.ui.suggest

Description: Show suggestions for query of an input.

  • .remotesearchUiSuggest( [ options ] )

    version added: 6.14.0

    options   A map of additional options pass to the method.

The .remotesearchUiSuggest() is only applicable to input elements from type text.

This widget displays suggests for the current value of the input field while typing.

  • Apply .remotesearchUiSuggest() to input field with id 'ProductSearchField'.

    HTML:
    <form action="?ViewAction=ViewRemoteSearchResults&ObjectID=12345" method="post">
      <input type="hidden" name="filter"/>
      <input type="text" name="SearchString" id="ProductSearchField" value=""/>
      <button type="submit" name="SearchButton">{Search}</button>
    </form>
    
    Code:
    de_epages('#ProductSearchField')
        .remotesearchUiSuggest({
            suggestUrl: '?ViewAction=ViewRemoteSearchSuggests&ObjectID=12345',
            searchFilter: 'input[name=filter]',
            suggestMax: 8,
            showImages: false
        });
    
    
  • searchFilter

    version added: 6.14.0

    A string containing a selector expression, a DOM element, an existing jQuery object for the filter input.

  • suggestUrl

    version added: 6.14.0

    A url to get suggestions for the query, the server needs to support JSONP via the callback argument.

  • suggestChars

    version added: 6.14.0

    An integer value of minimum required characters to start the suggest search.

    Default: 1

  • suggestMax

    version added: 6.14.0

    An integer value of maximum displayed suggestions.

    Default: 10

  • showImages

    version added: 6.14.0

    A boolean indication whether to display images in the suggest list.

    Default: true