New to Kendo UI for AngularStart a free 30-day trial

Definition

Package:@progress/kendo-angular-dropdowns

Selector:kendo-autocomplete

Export Name:Accessible in templates as #kendoAutoCompleteInstance="kendoAutoComplete"

Syntax:

html
<kendo-autocomplete
    [data]="['Item1', 'Item2', 'Item3']"
    placeholder="placeholder">
</kendo-autocomplete>

Inputs

Enables or disables the adaptive mode. By default, the adaptive rendering is disabled.

Default:

'none'

Sets the subtitle of the ActionSheet that renders instead of the Popup when using small screen devices. By default, the ActionSheet does not render a subtitle.

Sets the title of the ActionSheet that renders instead of the Popup when using small screen devices. By default, the ActionSheet title uses the text provided for the label of the AutoComplete.

Default:

''

data

any

Sets the data of the AutoComplete.

The data has to be provided in an array-like list.

disabled

boolean

Sets the disabled state of the component. To learn how to disable the component in reactive forms, refer to the article on Forms Support.

Default:

false

Sets the fillMode of the component. The default value is set by the Kendo theme.

filterable

boolean

Enables the filtering functionality. If set to true, the component emits the filterChange event.

Default:

false

Defines whether the first match from the suggestions list will be automatically focused. By default, highlightFirst is set to true.

Default:

true

inputAttributes

{ [key: string]: string }

Sets the HTML attributes of the inner focusable input element. Attributes which are essential for certain component functionalities cannot be changed.

Defines a Boolean function that is executed for each data item in the component (see examples). Determines whether the item will be disabled.

Sets the height of the options list in the popup. By default, listHeight is 200px.

The listHeight property affects only the list of options and not the whole popup container. To set the height of the popup container, use popupSettings.height.

When using adaptiveMode and the screen size is small or medium, the listHeight property is set to null.

Default:

200

loading

boolean

Sets and gets the loading state of the AutoComplete.

Default:

false

Sets the placeholder of the AutoComplete.

Default:

""

Configures the popup of the AutoComplete.

The available options are:

  • animate: Boolean—Controls the popup animation. By default, the open and close animations are enabled.
  • width: Number | String—Sets the width of the popup container. By default, the width of the host element is used. If set to auto, the component automatically adjusts the width of the popup and no item labels are wrapped. The auto mode is not supported when virtual scrolling is enabled.
  • height: Number—Sets the height of the popup container.
  • popupClass: String—Specifies a list of CSS classes that are used to style the popup.
  • appendTo: "root" | "component" | ViewContainerRef—Specifies the component to which the popup will be appended.

readonly

boolean

Sets the read-only state of the component.

Default:

false

Sets the border radius of the component. The default value is set by the Kendo theme.

Shows or hides the current group sticky header when using grouped data. By default, the sticky header is displayed (see example).

Default:

true

Sets the size of the component. The default value is set by the Kendo theme.

suggest

boolean

Enables the auto-completion of the text based on the first data item.

Default:

false

tabindex

number

Specifies the tabindex of the component.

Default:

0

value

string

Sets the value of the AutoComplete.

Specifies the string property of the data item that represents the item value. If the data contains only primitive values, do not define it.

The valueField property can be set to point to a nested property value - e.g. category.name.

Enables the virtualization functionality.

Default:

false

Fields

isOpen

boolean

Returns the current open state. Returns true if the popup or actionSheet is open.

Events

Fires each time the AutoComplete gets blurred.

close

EventEmitter​<PreventableEvent>

Fires each time the popup is about to close. This event is preventable. If you cancel it, the popup remains open.

Fires after the popup closes.

Fires each time the user types in the input field. You can filter the source based on the passed filtration value (see example).

Fires each time the user focuses the AutoComplete.

Fires each time the input element gets blurred.

Fires each time the user focuses the input element.

open

EventEmitter​<PreventableEvent>

Fires each time the popup is about to open. This event is preventable. If you cancel it, the popup remains closed.

Fires after the popup opens.

Fires each time the value changes— when the component is blurred or the value is cleared through the Clear button (see example. When the value of the component is programmatically changed to ngModel or formControl through its API or form binding, the valueChange event is not triggered because it might cause a mix-up with the built-in valueChange mechanisms of the ngModel or formControl bindings.

Methods

Blurs the AutoComplete.

Focuses the AutoComplete.

Focuses a specific item of the AutoComplete based on a provided index. If null or invalid index is provided the focus will be removed.

Parameters:indexnumber

Resets the value of the AutoComplete. If you use the reset method to clear the value of the component, the model will not update automatically and the valueChange event will not be fired.

Toggles the visibility of the popup or actionSheet. If you use the toggle method to open or close the popup or actionSheet, the open and close events will not be fired.

Parameters:open?boolean

The state of the popup.