Autocomplete

The Autocomplete widget is a textbox that provides suggestions while a user types into it.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/autocomplete
Export: default
Autocomplete interactive configuration
Copy Code
Copy to Codepen
$("#autocomplete").dxAutocomplete({
});

You can create the widget using one of the following approaches.

jQuery
JavaScript
HTML
$(function () {
    $("#autocomplete").dxAutocomplete({
        dataSource: autocompleteData,
        placeholder: 'Type country name...',
        valueExpr: 'name'
    });
});
<div id="autocomplete"></div>
Angular
HTML
<dx-autocomplete
    [dataSource]="autocompleteData"
    placeholder="Type country name..."
    valueExpr="name">
</dx-autocomplete>
AngularJS
HTML
<div dx-autocomplete="{
    dataSource: autocompleteData,
    placeholder: 'Type country name...',
    valueExpr: 'name'
}"></div>
Knockout
HTML
<div data-bind="dxAutocomplete: {
    dataSource: autocompleteData,
    placeholder: 'Type country name...',
    valueExpr: 'name'
}"></div>
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().Autocomplete()
    .ID("autocomplete")
    .DataSource(AutocompleteData)
    .Placeholder("Type country name...")
    .ValueExpr("name")
)
@(Html.DevExtreme().Autocomplete() _
    .ID("autocomplete") _
    .DataSource(AutocompleteData) _
    .Placeholder("Type country name...") _
    .ValueExpr("name")
)

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

View Demo

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the Autocomplete widget.

Methods

This section describes the members used to manipulate the widget.

Events

This section describes events fired by this widget.

See Also

Default Item Template

This section lists the data source fields that are used in a default item template.

By default, a predefined item template is applied to display the items of this widget. This template is based on certain fields of the data source provided for this widget. Below is the list of these fields. If the default item template is not appropriate for your task, implement a custom item template based on these or other fields of your data source.

See Also