Configuration

An object defining configuration options for the dxList widget.

activeStateEnabled

A Boolean value specifying whether or not the widget changes its state when interacting with a user.

Type: Boolean
Default Value: true

This option is used when the widget is displayed on a platform whose guidelines include the active state change for widgets.

Show Example:
jQuery

autoPagingEnabled

A Boolean value specifying whether or not to load the next page from the data source when the list is scrolled to the bottom.

Type: Boolean
Default Value: true

You can also load the next page's data on the "More" button click. Assign true to the showNextButton option to display the "more" button.

Show Example:
jQuery

contentReadyAction

An action performed when widget content is ready.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
Default Value: null

Assign a function to perform a custom action when widget content is ready.

Alternatively, you can assign a URL to which the browser will navigate when widget content is ready.

If data displayed by the widget is specified using a DataSource instance, the contentReadyAction is executed each time the load() method of the DataSource instance is called as well as when widget content is ready. In this case, when you create the widget, the contentReadyAction is executed twice: when widget content is ready (at this moment, the widget does not display items) and when the DataSource is loaded (the widget displays the loaded items).

dataSource

A data source used to fetch data to be displayed by the widget.

Default Value: null

You can assign an array directly to this option as well as use the Data Source provided by the DevExtreme library.

To display widget items, a default template can be used. This template is based on the data source fields that are listed in the Default Item Template section of the widget's API. Alternatively, you can implement a custom item template. For details refer to the Customize Widget Item Appearance topic.

Show Example:
jQuery

disabled

A Boolean value specifying whether or not the widget can respond to user interaction.

Type: Boolean
Default Value: false

Create an observable variable and assign it to this option to specify the availability of the widget at runtime.

Show Example:
jQuery

editConfig

An object used to set configuration options for the dxList's edit mode.

Type: Object

If you make the dxList widget editable, set the required edit mode. For this purpose, use the deleteEnabled and/or selectionEnabled fields of the editConfig configuration object.

The dxList widget comes with several predefined modes for item deletion and selection. You can set the required mode using the deleteMode and/or selectionMode fields of the editConfig configuration object. The predefined modes enclose a specific item appearance and control elements for deletion and selection. You can also specify a custom HTML template for selectable/deletable list items using the itemRender or itemTemplate option of the editConfig configuration object. In this case, the selectItem, deleteItem and unselectItem widget methods will be useful.

Show Example:
jQuery

editEnabled

Specifies whether the item list represented by this widget is editable.

Type: Boolean
Default Value: false

When this option is set to true, the item list becomes editable. Once it is editable, list items can be selected or deleted. To set the required edit mode, use the editConfig configuration option.

In addition, items in an editable list can be selected or deleted from code using the selectItem, deleteItem and unselectItem methods.

You can perform certain actions when an item is deleted, selected or deselected. For this purpose, implement an action and assign it to the itemDeleteAction, itemSelectAction or itemUnselectAction configuration option.

grouped

A Boolean value specifying whether or not to display a grouped list.

Type: Boolean
Default Value: false

If this option is set to 'true', the object assigned to the items option should include the key and items properties. The key property specifies the group caption in the list. The items property represents an array listing the group items.

Show Example:
jQuery

groupRender

A function rendering a group header.

Type: function
Function parameters:
groupData: Object
An object representing the group to be rendered.
groupIndex: Number
The index of the group to be rendered.
groupElement: Object
An HTML element containing the group to be rendered.
Return Value: String|DOM Node|jQuery
An HTML string, Element, or jQuery object representing the rendered group caption.
Default Value: null

The rendering function should have the following parameters and return an HTML string, element, or jQuery object representing the rendered group.

  • groupData - the data source element representing the rendered group
  • groupIndex - the index of the rendered group
  • groupElement - the HTML element containing the rendered group
Show Example:
jQuery

groupTemplate

The name of the template used to display a group header.

Type: String|function|DOM Node|jQuery
Return Value: String|jQuery
A template name or a template container.
Default Value: "group"

Show Example:
jQuery

height

Specifies the height of the widget.

Type: Number|String|function
Return Value: Number|String
The widget height.
Default Value: undefined

The option can hold a value of the following types.

  • numeric
    The widget height in pixels.
  • string
    A CSS measurement of the widget height (e.g., "55px", "80%", "auto" and "inherit").
  • function
    The function returning the widget height. For example, see the following code.

    JavaScript
    height: function () { 
        return baseHeight - 10 + "%";
    }

hoverStateEnabled

A Boolean value specifying whether or not the widget changes its state when being hovered by an end user.

Type: Boolean
Default Value: true

itemClickAction

An action performed when a collection item is clicked.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
itemData: Object
The data that is bound to the clicked item.
itemElement: jQuery
An HTML element of the item.
Default Value: null

Assign a function to perform a custom action when the widget's collection item is clicked.

Alternatively, you can assign a URL to which the browser will navigate when the item is clicked.

itemDeleteAction

An action performed when a list item is deleted.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
itemData: Object
The data that is bound to the removed item.
itemElement: jQuery
An HTML element of the item.
Default Value: null

Assign a function to perform a custom action when a list item is deleted.

Alternatively, you can assign a URL to which the browser will navigate when a list item is deleted.

itemHoldAction

An action performed when an item is being held for a specified time period.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
itemData: Object
The data that is bound to the item being held.
itemElement: jQuery
An HTML element of the item.
Default Value: null

Assign a function to perform a custom action when the widget's collection item is being held for a specified time period (see the itemHoldTimeout option).

Alternatively, you can assign a URL to which the browser will navigate when item content is being held for a specified time period.

Show Example:
jQuery

itemHoldTimeout

The time period in milliseconds before itemHoldAction execution.

Type: Number
Default Value: 750

Show Example:
jQuery

itemRender

A function used to render collection items.

Type: function
Function parameters:
itemData: Object
An object representing the item to be rendered.
itemIndex: Number
The index of the item to be rendered.
itemElement: jQuery
An HTML element containing the item to be rendered.
Return Value: String|DOM Node|jQuery
An HTML string, Element, or jQuery object representing the rendered item.
Default Value: null

As in all container widgets in DevExtreme, items of this widget are displayed by a default HTML template. This template is based on certain fields of the data source. You can define a custom item template that will use specific fields of the data source. To learn more about item templates, refer to the Customize Widget Item Appearance topic.

Implement the itemRender function to provide a custom item template for a given collection item. This function is called each time a collection item of the widget is rendered.

Return an HTML string, Element, or jQuery object representing the rendered item.

Alternatively, you can define the dxTemplate markup component within the widget element and set its name option to item. In this case, the markup enclosed into the dxTemplate component will be automatically applied as an item template. In addition, you may need to define several item templates and apply each of them when required. In this instance, use the itemTemplate option to set the required template.

Refer to the Customize Widget Item Appearance topic to learn more about ways to render collection items.

Show Example:
jQuery

itemRenderedAction

An action performed after a collection item is rendered.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
itemData: Object
The data that is bound to the rendered item.
itemElement: jQuery
An HTML element of the item.
Default Value: null

Assign a function to perform a custom action after a collection item is rendered.

Alternatively, you can assign a URL to which the browser will navigate after a collection item is rendered.

itemReorderAction

An action performed when a list item is moved to another position.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
itemData: Object
The data that is bound to the reordered item.
toIndex: Number
An HTML element of the item.
Default Value: null

Assign a function to perform a custom action when a list item is moved to another position.

Alternatively, you can assign a URL to which the browser will navigate when a list item is moved to another position.

items

An array of items displayed by the widget.

Type: Array

You can use the dataSource option instead. Unlike the items option, the dataSource option can take on the DataSource configuration object as well as a simple array.

itemSelectAction

An action performed when a list item is selected.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
itemData: Object
The data that is bound to the selected item.
itemElement: jQuery
An HTML element of the item.
Default Value: null

Assign a function to perform a custom action when a list item is selected.

Alternatively, you can assign a URL to which the browser will navigate when a list item is selected.

itemSwipeAction

An action performed when an item is swiped.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
jQueryEvent: jQuery.Event
Specifies the event that caused the action execution.
itemData: Object
The data that is bound to the swiped item.
itemElement: jQuery
An HTML element of the item.
direction: String
Specifies whether the swipe operation is performed in the left or right direction.
Default Value: null

Assign a function to perform a custom action when an item is swiped.

Alternatively, you can assign a URL to which the browser will navigate when an item is swiped.

Show Example:
jQuery

itemTemplate

The template to be used for rendering items.

Type: String|function|DOM Node|jQuery
Return Value: String|jQuery
A template name or a template container.
Default Value: "item"

As in all container widgets in DevExtreme, items of this widget are displayed by a default HTML template. This template is based on specific data source fields. You can define a custom item template that will use specific fields of the data source. To learn more about item templates, refer to the Customize Widget Item Appearance topic.

In a simple case, you can define a single custom template for widget items using the dxTemplate markup component within the widget's container. Set the name option of this component to 'item'. In this instance, this template will automatically be used as an item template, and you don't have to specify the itemTemplate option.

However, in some cases you may need to have several custom item templates defined within the widget's container and apply each of them in different scenarios. In this instance, use one of the following ways of setting the required template to the itemTemplate option.

  • Assign a string representing the name of the required template.
  • Assign a function that returns the name of the template as a result of a certain logic.

When you have several collection widgets, you may need to define a common template for them. For this purpose, factor out a template into a separate element, as demonstrated below.

HTML
<script type="text/html" id="person-template">
    <h3 data-bind="text: name"></h3>
    <p>Address: <span data-bind="text: address"></span></p>
</script>

To set the common template as a collection item template, assign one of the following values to the itemTemplate option.

  • Assign a jQuery object representing the template's container
  • Assign a DOM Node representing the template's container
  • Assign a function that returns the jQuery object or a DOM Node representing the template's container

You can use a custom template engine. For this purpose, call the DevExpress.ui.setTemplateEngine(name) method passing the name of one of the supported template engine. You can see a demo where a custom template engine is used: Data Grid - Row Underscore Template.

Show Example:
jQuery

itemUnselectAction

An action performed when a list item is deselected.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
itemData: Object
The data that is bound to the unselected item.
itemElement: jQuery
An HTML element of the item.
Default Value: null

Assign a function to perform a custom action when a list item is deselected.

Alternatively, you can assign a URL to which the browser will navigate when a list item is deselected.

nextButtonText

The text displayed on the button used to load the next page from the data source.

Type: String
Default Value: "More"

Show Example:
jQuery

noDataText

The text displayed by the widget if the item collection is empty.

Type: String
Default Value: "No data to display"

pageLoadingAction

An action performed before loading the next page when autopaging is enabled.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
Default Value: null

Assign a function to perform a custom action before loading the next page.

Alternatively, you can assign a URL to which the browser will navigate before loading the next page.

pageLoadingText

Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom.

Type: String
Default Value: "Loading..."

pulledDownText

Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold.

Type: String
Default Value: "Release to refresh..."

pullingDownText

Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold.

Type: String
Default Value: "Pull down to refresh..."

pullRefreshAction

An action performed before the list is refreshed as a result of the "pull down to refresh" gesture.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
Default Value: null

Assign a function to perform a custom action before the list is refreshed as a result of the "pull down to refresh" gesture.

Alternatively, you can assign a URL to which the browser will navigate before the list is refreshed as a result of the "pull down to refresh" gesture.

pullRefreshEnabled

A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture.

Type: Boolean
Default Value: false

If the option is set to true, list data is refreshed each time you pull down and release list contents.

NOTE: The "pull down to refresh" gesture is not supported by desktop browsers and Windows Phone devices. You can use it only in mobile themes except the Windows Phone theme.

Show Example:
jQuery

refreshingText

Specifies the text displayed in the pullDown panel while the list is being refreshed.

Type: String
Default Value: "Refreshing..."

rtlEnabled

Specifies whether or not the current component supports a right-to-left representation.

Type: Boolean
Default Value: false

If you need to switch the display of this DevExtreme component to right-to-left, enable a specifically designed configuration option - rtlEnabled. When this option is set to true, the text flows from right to left, and the layout the component's elements is reversed. To switch the entire application/site to a right-to-left representation, use the static DevExpress.rtlEnabled field.

scrollAction

An action performed on each scroll gesture.

Type: String|function(e)
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
jQueryEvent: jQuery.Event
Specifies the jQuery event that caused the action's execution.
scrollOffset: Object
Returns the current scroll offset in the following format { top: topOffset, left: leftOffset }.
reachedLeft: Boolean
Indicates whether or not the container's left boundary is reached.
reachedRight: Boolean
Indicates whether or not the container's right boundary is reached
reachedTop: Boolean
Indicates whether or not the container's top boundary is reached.
reachedBottom: Boolean
Indicates whether or not the container's bottom boundary is reached.
Default Value: null

Assign a function to perform a custom action on each scroll gesture.

Alternatively, you can assign a URL to which the browser will navigate on each scroll gesture.

scrollingEnabled

A Boolean value specifying whether to enable or disable list scrolling.

Type: Boolean
Default Value: true

selectedItems

Specifies the selected list items.

Type: Array

To select items when the widget is rendered, set the editEnabled option to true and assign an array with links to the data source items to the selectedItems option.

To determine which items are currently selected, use the widget's option method passing the selectedItems as a parameter.

selectionMode

Specifies whether the list supports single item selection or multi-selection.

Type: String
Default Value: 'multi'
Accepted Values: 'multi'|'single'

showNextButton

A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked.

Type: Boolean
Default Value: false

If this option is set to true, the widget shows a "Next Page" button, and loads the next page of data when you click this button. Otherwise, the widget loads the data automatically each time you reach the bottom of the list.

NOTE: The default value of this option is false if your application is running on a mobile platform. If you run the application on the desktop, the default value is true.

Show Example:
jQuery

showScrollbar

A Boolean value specifying if the widget scrollbar is visible.

Type: Boolean
Default Value: true

Show Example:
jQuery

useNativeScrolling

Specifies whether or not the widget uses native scrolling.

Type: Boolean
Default Value: true
Default for android below version 4: false
Default for tizen: false

visible

A Boolean value specifying whether or not the widget is visible.

Type: Boolean
Default Value: true

width

Specifies the width of the widget.

Type: Number|String|function
Return Value: Number|String
The widget width.
Default Value: undefined

The option can hold a value of the following types.

  • numeric
    The widget width in pixels.
  • string
    A CSS measurement of the widget width (e.g., "55px", "80%", "auto" and "inherit").
  • function
    The function returning the widget width. For example, see the following code.

    JavaScript
    width: function () { 
        return baseWidth - 10 + "%";
    }