React List API

The List is a UI component that represents a collection of items in a scrollable list.

import List from "devextreme-react/list"
Selector: List

Configuration

An object defining configuration properties for the List UI component.

Name Description
accessKey

Specifies the shortcut key that sets focus on the UI component.

activeStateEnabled

Specifies whether the UI component changes its visual state as a result of user interaction.

allowItemDeleting

Specifies whether or not an end user can delete list items.

bounceEnabled

A Boolean value specifying whether to enable or disable the bounce-back effect.

collapsibleGroups

Specifies whether or not an end user can collapse groups.

dataSource

Binds the UI component to data.

disabled

Specifies whether the UI component responds to user interaction.

displayExpr

Specifies the data field whose values should be displayed. Defaults to "text" when the data source contains objects.

elementAttr

Specifies the global attributes to be attached to the UI component's container element.

focusStateEnabled

Specifies whether the UI component can be focused using keyboard navigation.

groupComponent

An alias for the groupTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

grouped

Specifies whether data items should be grouped.

groupRender

An alias for the groupTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

groupTemplate

Specifies a custom template for group captions.

height

Specifies the UI component's height.

hint

Specifies text for a hint that appears when a user pauses on the UI component.

hoverStateEnabled

Specifies whether the UI component changes its state when a user pauses on it.

indicateLoading

Specifies whether or not to show the loading panel when the DataSource bound to the UI component is loading data.

itemComponent

An alias for the itemTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

itemDeleteMode

Specifies the way a user can delete items from the list.

itemDragging

Configures item reordering using drag and drop gestures.

itemHoldTimeout

The time period in milliseconds before the onItemHold event is raised.

itemRender

An alias for the itemTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

items

An array of items displayed by the UI component.

itemTemplate

Specifies a custom template for items.

keyExpr

Specifies the key property that provides key values to access data items. Each key value must be unique.

menuItems

Specifies the array of items for a context menu called for a list item.

menuMode

Specifies whether an item context menu is shown when a user holds or swipes an item.

nextButtonText

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

noDataText

Specifies the text or HTML markup displayed by the UI component if the item collection is empty.

onContentReady

A function that is executed when the UI component is rendered and each time the component is repainted.

onDisposing

A function that is executed before the UI component is disposed of.

onGroupRendered

A function that is executed when a group element is rendered.

onInitialized

A function used in JavaScript frameworks to save the UI component instance.

onItemClick

A function that is executed when a collection item is clicked or tapped.

onItemContextMenu

A function that is executed when a collection item is right-clicked or pressed.

onItemDeleted

A function that is executed after a list item is deleted from the data source.

onItemDeleting

A function that is executed before a collection item is deleted from the data source.

onItemHold

A function that is executed when a collection item has been held for a specified period.

onItemRendered

A function that is executed after a collection item is rendered.

onItemReordered

A function that is executed after a list item is moved to another position.

onItemSwipe

A function that is executed when a list item is swiped.

onOptionChanged

A function that is executed after a UI component property is changed.

onPageLoading

A function that is executed before the next page is loaded.

onPullRefresh

A function that is executed when the "pull to refresh" gesture is performed. Supported on mobile devices only.

onScroll

A function that is executed on each scroll gesture.

onSelectAllValueChanged

A function that is executed when the "Select All" check box value is changed. Applies only if the selectionMode is "all".

onSelectionChanged

A function that is called after selection changes.

onSelectionChanging

A function that is called before selection changes.

pageLoadingText

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

pageLoadMode

Specifies whether the next page is loaded when a user scrolls the UI component to the bottom or when the "next" button is clicked.

pulledDownText

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

pullingDownText

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

pullRefreshEnabled

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

refreshingText

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

repaintChangesOnly

Specifies whether to repaint only those elements whose data changed.

rtlEnabled

Switches the UI component to a right-to-left representation.

scrollByContent

A Boolean value specifying if the list is scrolled by content.

scrollByThumb

Specifies whether a user can scroll the content with the scrollbar. Applies only if useNativeScrolling is false.

scrollingEnabled

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

searchEditorOptions

Configures the search panel.

searchEnabled

Specifies whether the search panel is visible.

searchExpr

Specifies a data object's field name or an expression whose value is compared to the search string.

searchMode

Specifies a comparison operation used to search UI component items.

searchTimeout

Specifies a delay in milliseconds between when a user finishes typing, and the search is executed.

searchValue

Specifies the current search string.

selectAllMode

Specifies the mode in which all items are selected.

selectAllText

Specifies the text displayed at the "Select All" check box.

selectByClick

Specifies whether an item is selected if a user clicks it.

selectedItemKeys

Specifies an array of currently selected item keys.

selectedItems

An array of currently selected item objects.

selectionMode

Specifies item selection mode.

showScrollbar

Specifies when the UI component shows the scrollbar.

showSelectionControls

Specifies whether or not to display controls used to select list items.

tabIndex

Specifies the number of the element when the Tab key is used for navigating.

useNativeScrolling

Specifies whether or not the UI component uses native scrolling.

visible

Specifies whether the UI component is visible.

width

Specifies the UI component's width.

Methods

This section describes members used to manipulate the UI component.

Name Description
beginUpdate()

Postpones rendering that can negatively affect performance until the endUpdate() method is called.

clientHeight()

Gets the UI component's height in pixels.

collapseGroup(groupIndex)

Collapses a group with a specific index.

defaultOptions(rule)

Specifies the device-dependent default configuration properties for this component.

deleteItem(itemElement)

Removes an item found using its DOM node.

deleteItem(itemIndex)

Removes an item with a specific index.

dispose()

Disposes of all the resources allocated to the List instance.

element()

Gets the root UI component element.

endUpdate()

Refreshes the UI component after a call of the beginUpdate() method.

expandGroup(groupIndex)

Expands a group with a specific index.

focus()

Sets focus on the UI component.

getDataSource()

Gets the DataSource instance.

getInstance(element)

Gets the instance of a UI component found using its DOM node.

instance()

Gets the UI component's instance. Use it to access other methods of the UI component.

isItemSelected(itemElement)

Checks whether an item found using its DOM node is selected.

isItemSelected(itemIndex)

Checks whether an item with a specific index is selected.

off(eventName)

Detaches all event handlers from a single event.

off(eventName, eventHandler)

Detaches a particular event handler from a single event.

on(eventName, eventHandler)

Subscribes to an event.

on(events)

Subscribes to events.

option()

Gets all UI component properties.

option(optionName)

Gets the value of a single property.

option(optionName, optionValue)

Updates the value of a single property.

option(options)

Updates the values of several properties.

registerKeyHandler(key, handler)

Registers a handler to be executed when a user presses a specific key.

reload()

Reloads list data.

reorderItem(itemElement, toItemElement)

Reorders items found using their DOM nodes.

reorderItem(itemIndex, toItemIndex)

Reorders items with specific indexes.

repaint()

Renders the component again without reloading data. Use the method to update the component's markup and appearance dynamically.

resetOption(optionName)

Resets a property to its default value.

scrollBy(distance)

Scrolls the content by a specified distance.

scrollHeight()

Gets the content's height in pixels.

scrollTo(location)

Scrolls the content to a specific position.

scrollToItem(itemElement)

Scrolls the content to an item found using its DOM node.

scrollToItem(itemIndex)

Scrolls the content to an item with a specific index.

scrollTop()

Gets the top scroll offset.

selectAll()

Selects all items.

selectItem(itemElement)

Selects an item found using its DOM node.

selectItem(itemIndex)

Selects an item with a specific index.

unselectAll()

Cancels the selection of all items.

unselectItem(itemElement)

Cancels the selection of an item found using its DOM node.

unselectItem(itemIndex)

Cancels the selection of an item with a specific index.

updateDimensions()

Updates the UI component scrollbar according to UI component content size.

See Also

Events

This section describes events fired by this UI component.

Name Description
contentReady

Raised when the UI component is rendered and each time the component is repainted.

disposing

Raised before the UI component is disposed of.

groupRendered

Raised when a group element is rendered.

initialized

Raised only once, after the UI component is initialized.

itemClick

Raised when a collection item is clicked or tapped.

itemContextMenu

Raised when a collection item is right-clicked or pressed.

itemDeleted

Raised after a list item is deleted from the data source.

itemDeleting

Raised before a collection item is deleted from the data source.

itemHold

Raised when a collection item has been held for a specified period.

itemRendered

Raised after a collection item is rendered.

itemReordered

Raised after a list item is moved to another position.

itemSwipe

Raised when a list item is swiped.

optionChanged

Raised after a UI component property is changed.

pageLoading

Raised before the next page is loaded.

pullRefresh

Raised when the "pull to refresh" gesture is performed.

scroll

Raised on each scroll gesture.

selectAllValueChanged

Raised when the "Select All" check box value is changed.

selectionChanged

Raised after selection changes.

selectionChanging

Raised before selection changes.

See Also

Types

Name Description
ContentReadyEvent

The type of the contentReady event handler's argument.

DisposingEvent

The type of the disposing event handler's argument.

GroupRenderedEvent

The type of the groupRendered event handler's argument.

InitializedEvent

The type of the initialized event handler's argument.

ItemClickEvent

The type of the itemClick event handler's argument.

ItemContextMenuEvent

The type of the itemContextMenu event handler's argument.

ItemDeletedEvent

The type of the itemDeleted event handler's argument.

ItemDeleteMode

Specifies the way a user can delete items from the list.

ItemDeletingEvent

The type of the itemDeleting event handler's argument.

ItemHoldEvent

The type of the itemHold event handler's argument.

ItemRenderedEvent

The type of the itemRendered event handler's argument.

ItemReorderedEvent

The type of the itemReordered event handler's argument.

ItemSwipeEvent

The type of the itemSwipe event handler's argument.

ListMenuMode

Specifies whether an item context menu is shown when a user holds or swipes an item.

OptionChangedEvent

The type of the optionChanged event handler's argument.

PageLoadingEvent

The type of the pageLoading event handler's argument.

PullRefreshEvent

The type of the pullRefresh event handler's argument.

ScrollEvent

The type of the scroll event handler's argument.

SelectAllValueChangedEvent

The type of the selectAllValueChanged event handler's argument.

SelectionChangedEvent

The type of the selectionChanged event handler's argument.

SelectionChangingEvent

The type of the selectionChanging event handler's argument.