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 - Row Editing

The TreeList allows users to edit data in multiple modes. This demo shows the "row" edit mode. To edit a row, click its "Edit" button. Only one row can be in the edit state at a time.

To enable row edit mode, set the mode property to "row" and enable the editing object's allowUpdating, allowAdding, and allowDeleting properties to allow edit operations.

To give you the ability to edit code on the fly, the demo uses SystemJS. For this reason, launching the demo takes some time. We strongly recommend that you do not use this approach in real projects.
Backend API

Buttons for allowed edit operations are displayed in an edit column. To customize it programmatically, declare a column of the buttons type and specify the available buttons. In this demo, the buttons column is used to hide the "Add" button in each row. See the following help topic for more details on edit column customization: Customize the Edit Column.

This demo also illustrates the following event handlers:

  • onInitNewRow
    Populates cells of a new row with default values. In this demo, onInitNewRow sets John Heart as the initial Head for new rows.

  • onEditorPreparing
    Customizes cell editors. In this demo, this handler disallows users to edit the Head value of John Heart.

Refer to the following help topic to see the full list of the events that edit operations raise: Editing Events.