Autocomplete

  • module
autocomplete

{can.Component}

 

The autocomplete component renders a search input. It will search the provided model and render a list of results below the search input. When a result is selected, the component will replace the search string with the result.

<bit-autocomplete></bit-autocomplete>

Parameters

  1. model {can.Model}

    Contains the model to search with.

  2. search-field-id {String}

    The ID of the input element.

  3. validited {boolean}

    Marks when a selection is made.

  4. selected-item {can.Map}

    The selected item object.

  5. debounce-delay {Number}

    The amount of time to wait before searching.

  6. character-delay {Number}

    The number of characters that must be entered to trigger a search.

Component Initialization

  <bit-autocomplete model="{model}"></bit-autocomplete>

Add the inputName and results values if needed.

  <bit-autocomplete model="{model}" selected-item="{selectedItem}" validated="{validated}"></bit-autocomplete>