The TreeView widget is a tree-like representation of textual data.

Included in: dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/tree_view
TreeView interactive configuration
Copy Code
Copy to Codepen


You can create the widget using one of the following approaches.

  • jQuery
    Use the dxTreeView jQuery plug-in.

    <div id="treeView"></div>
    var treeViewData = [
        { id: 1, parentId: 0, text: "Animals" },
        { id: 2, parentId: 1, text: "Cat" },
        { id: 3, parentId: 1, text: "Dog" },
        { id: 4, parentId: 1, text: "Cow" },
        { id: 5, parentId: 2, text: "Abyssinian" },
        { id: 6, parentId: 2, text: "Aegean cat" },
        { id: 7, parentId: 2, text: "Australian Mist" },
        { id: 8, parentId: 3, text: "Affenpinscher" },
        { id: 9, parentId: 3, text: "Afghan Hound" },
        { id: 10, parentId: 3, text: "Airedale Terrier" },
        { id: 11, parentId: 3, text: "Akita Inu" },
        { id: 12, parentId: 0, text: "Birds" },
        { id: 13, parentId: 12, text: "Akekee" },
        { id: 14, parentId: 12, text: "Arizona Woodpecker" },
        { id: 15, parentId: 12, text: "Black-chinned Sparrow" }
        dataSource: treeViewData,
        dataStructure: 'plain'
  • Knockout
    Add a div element and apply the dxTreeView binding to this element.

    <div data-bind="dxTreeView: {
        dataSource: treeViewData,
        dataStructure: 'plain'
  • AngularJS
    Add a div element and apply the dx-tree-view directive to this element.

    <div dx-tree-view="{
        dataSource: treeViewData,
        dataStructure: 'plain'

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

Since the TreeView widget is used to display multiple items, it supports common Collection Container widget functionality. You can find detailed information on the principles of working with the widget in the dxTreeView section of the Collection Container Widgets article.

The TreeView widget requires each data source item to contain at least a key field. Thus, the widget does not support data sources consisting of value items.

View Demo

Watch Video

Show Example:


An object defining configuration options for the TreeView widget.


This section describes members used to manipulate the widget.


This section describes events fired by this widget.

Default Item Template

This section lists the data source fields that are used in a default item template.

By default, a predefined item template is applied to display the items of this widget. This template is based on certain fields of the data source provided for this widget. Below is the list of these fields. If the default item template is not appropriate for your task, implement a custom item template based on these or other fields of your data source.

See Also