A widget that allows you to select an item in a dropdown list.

Included in: dx.phonejs.js, dx.webappjs.js, dx.all.js

The dxSelectBox widget is a dropdown list of selectable items.

This widget, like any other DevExtreme UI widget, can be created using one of three possible approaches: jQuery, Knockout or AngularJS. The following code demonstrates how to create the dxSelectBox widget using the Knockout approach.

<div data-bind="dxSelectBox:{dataSource: employees, displayExpr: 'name', valueExpr: 'id'}"></div>

The select box items are loaded from an array specified using the dataSource configuration option. You can specify a simple array or the array of objects as the widget data source.

var employees = [
    { id:1, name: "Bob", hired: 2005 },
    { id:2, name: "John", hired: 2007 },
    { id:3, name: "Frank", hired: 2001 },
    { id:4, name: "Robert", hired: 2007 },
    { id:5, name: "Paul", hired: 2011 },
    { id:6, name: "Elizabeth", hired: 2000 },
    { id:7, name: "Mary", hired: 2002 },
    { id:8, name: "Michael", hired: 2003 },
    { id:9, name: "George", hired: 2002 },
    { id:10, name: "Deborah", hired: 2000 },
    { id:11, name: "Lisa", hired: 1999 },
    { id:12, name: "Mark", hired: 2011 }

To display select box items, a default template is applied based on the following fields of the data source item objects.

  • disabled
    Specifies whether or not the select box item is disabled.
  • visible
    Specifies whether or not the select box item is visible.
  • html
    Specifies the html code inserted into the item element.
  • text
    Specifies the text inserted into the item element.

If there is no text field in the data source objects, set another data source field to the displayExpr configuration option to enable a user to select the required object by the value of this field.

You can introduce a custom template for select box items. For this purpose, add a div element with the data-options attribute set to dxTemplate. Assign item to the template name. In this instance, the template will be applied automatically. See the Customize Widget Item Appearance topic to learn more about templates.

See Also
  • To learn how to create widgets in detail, refer to the Create a Widget article.
  • The dxSelectBox widget is related to the Collection Containers and Editors categories. Read an overview of the features that are common for collection container widgets in the Common Tasks topic of the Collection Containers article. To learn about the features that are typical for editors, refer to the Common Tasks topic of the Editors article.
Show Example:


An object defining configuration options for the dxSelectBox widget.


This section describes the members used to manipulate the widget.


This section describes events fired by this component.

Default Item Template

This section lists the data source fields that are used in a default template for autocomplete drop-down items.

By default, a predefined item template is applied to display items of DevExtreme collection widgets. This template is based on certain fields of the data source provided for a widget. Below is the list of the fields that take part in a default item template for the dxAutocomplete widget. 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. For details refer to the Customize Widget Item Appearance topic.