DevExtreme Vue - Configure Search Parameters

The Autocomplete can provide suggestions in two different modes: 'contains' (by default) and 'startswith'. You can use the searchMode option to change the mode.

JavaScript
  • var autocompleteData = [
  • { country: "Afghanistan", capital: "Kabul" },
  • { country: "Albania", capital: "Tirana" },
  • // ...
  • ];
  •  
  • $(function() {
  • $("#autocompleteContainer").dxAutocomplete({
  • dataSource: autocompleteData,
  • valueExpr: 'country',
  • searchMode: 'startswith'
  • });
  • });

By default, the Autocomplete widget starts providing suggestions once an end user types the first character. To increase the number of characters that triggers suggestions, use the minSearchLength option.

JavaScript
  • $(function() {
  • $("#autocompleteContainer").dxAutocomplete({
  • // ...
  • minSearchLength: 3
  • });
  • });

You can also specify the time interval the widget should wait before providing suggestions. Assign this time interval measured in milliseconds to the searchTimeout option.

JavaScript
  • $(function() {
  • $("#autocompleteContainer").dxAutocomplete({
  • // ...
  • searchTimeout: 500
  • });
  • });
See Also