React TreeList - toolbar

Configures the toolbar.

Selector: Toolbar
Type:

dxTreeListToolbar

| undefined
Default Value: undefined

disabled

Specifies whether the toolbar responds to user interaction.

Type:

Boolean

Default Value: false

items[]

Configures toolbar items.

The toolbar can contain the following elements as items:

  • Predefined controls
    Predefined controls appear on the toolbar depending on whether a specific TreeList feature is enabled. The following table illustrates the dependency:

    Control NameImagePrerequisites
    addRowButtonDevExtreme JavaScript jQuery Angular UI component TreeList Toolbar AddButtonediting.allowAdding is true
    applyFilterButtonDevExtreme JavaScript jQuery Angular UI component TreeList Toolbar ApplyFilterButtonfilterRow.visible is true and filterRow.applyFilter is set to "onClick"
    columnChooserButtonDevExtreme JavaScript jQuery Angular UI component TreeList Toolbar ColumnChooserButtoncolumnChooser.enabled is true
    revertButtonDevExtreme JavaScript jQuery Angular UI component TreeList Toolbar RevertButtonediting.mode is set to "batch"
    saveButtonDevExtreme JavaScript jQuery Angular UI component TreeList Toolbar SaveButtonediting.mode is set to "batch" and editing.allowUpdating is true
    searchPanelDevExtreme JavaScript jQuery Angular UI component TreeList Toolbar searchPanelsearchPanel.visible is true

    If you need to customize a predefined control, add an object to the items[] array. This object must contain the control's name and properties that you want to customize. If a control does not need customization, simply include its name in the toolbar.items[] array.

    The example below customizes the Column Chooser button, adds an Add Row button, and enables the corresponding TreeList features:

    App.js
    • import TreeList, { Editing, Toolbar, Item, ColumnChooser } from 'devextreme-react/tree-list';
    • // ...
    • function App() {
    • return (
    • <TreeList ... >
    • <Editing allowAdding={true} />
    • <ColumnChooser enabled={true} />
    • <Toolbar>
    • <Item name="addRowButton" />
    • <Item
    • name="columnChooserButton"
    • locateInMenu="auto"
    • location="after"
    • />
    • </Toolbar>
    • </TreeList>
    • );
    • }
    IMPORTANT
    The TreeList does not display controls missing from the items[] array. Ensure that this array includes controls for all enabled features.
  • DevExtreme components

    You can use DevExtreme components as toolbar items. Declare an Item element to add a supported component:

    App.js
    • import { SelectBox } from 'devextreme-react/select-box';
    • import TreeList, { Toolbar, Item } from 'devextreme-react/tree-list';
    • // ...
    • function App() {
    • return (
    • <TreeList ... >
    • <Toolbar>
    • <Item>
    • <SelectBox>
    • {/* SelectBox properties are specified here */}
    • </SelectBox>
    • </Item>
    • </Toolbar>
    • </TreeList>
    • );
    • }
  • Custom controls
    To use a custom control, specify a template for it.

DataGrid Demo

visible

Specifies whether the toolbar is visible.

Type:

Boolean

| undefined
Default Value: undefined