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
Export: default
TreeView interactive configuration
Copy Code
Copy to Codepen


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

  • jQuery

    <div id="treeView"></div>
    var species = [
        { id: 1, parentId: 0, text: "Species" },
        { 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" }
    $(function () {
            dataSource: species,
            dataStructure: 'plain'
  • Angular

    export class AppComponent {
        species = [
            // ...   
  • AngularJS

    <div ng-controller="DemoController">
        <div dx-tree-view="{
            dataSource: species,
            dataStructure: 'plain'
    angular.module('DemoApp', ['dx'])
        .controller("DemoController", function ($scope) {
            $scope.species = [
                // ...   
  • Knockout

    <div data-bind="dxTreeView: {
        dataSource: species,
        dataStructure: 'plain'
    var viewModel = {
        species: [
            // ...
  • ASP.NET MVC Wrappers

    Razor C#
    Razor VB
    @(Html.DevExtreme().TreeView() _
        .ID("treeView") _
        .DataSource(Species) _

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 topics in the Installation section.

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

See Also
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.


A TreeView node.

This section describes the contents of a TreeView node object. Such objects can be accessed using the getNodes() method and within functions handling the events whose name begins with item....

See Also

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