DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React Tree List - Focused Row

The TreeList component can highlight the focused row. To enable this feature, set the focusedRowEnabled property to true.

To focus a row programmatically, specify the focusedRowKey property. The TreeList automatically scrolls to the focused row. You can set the autoNavigateToFocusedRow property to false to deactivate this behavior. In the UI, users can click a row to focus it. The focused row is saved in the TreeList's state.

You can use the onFocusedRowChanging and onFocusedRowChanged properties to specify a custom function that is executed before or after a row is focused.

This demo may be temporarily unavailable due to an issue with the UNPKG service we use for resource loading. You can vote on it in the

UNPKG repository

We're working on a fix — sorry for the inconvenience.

Backend API

In this demo, the row with the 45 key is focused initially. You can specify the focusedRowKey property via the input field below the TreeList. The onFocusedRowChanged function is used to display additional information below the component when the focused row changes.