All Components

DropDownTree Overview

The DropDownTree is an editor of hierarchical data, rendered in a tree-like structure, which provides multiple selection options and custom nodes.

The DropDownTree wrapper for Vue is a client-side wrapper for the Kendo UI DropDownTree widget.

Installation

To initialize the DropDownTree, either:

Initializing from CDN

The following example demonstrates how to initialize the DropDownTree component by using the CDN services. To access all CDN references, open the sample in Plunker.

<div id="vueapp" class="vue-app">
    <kendo-dropdowntree :data-source="localDataSource" :placeholder="'Select ...'" style="width: 300px;"></kendo-dropdowntree>
</div>
Vue.use(DropDownTreeInstaller);

new Vue({
    el: "#vueapp",
    data: function() {
        return {
            localDataSource: new kendo.data.HierarchicalDataSource({
                data: [{
                    text: 'Furniture',
                    items: [
                        { text: 'Tables & Chairs' },
                        { text: 'Sofas' },
                        { text: 'Occasional Furniture' }
                    ]
                }, {
                    text: 'Decor',
                    items: [
                        { text: 'Bed Linen' },
                        { text: 'Curtains & Blinds' },
                        { text: 'Carpets' }
                    ]
                }]
            })
        }
    }
})

Initializing with Webpack

  1. Install Kendo UI and add a theme.

    npm install --save @progress/kendo-ui
    npm install --save @progress/kendo-theme-default
  2. Install the Kendo UI DropDownTree package for Vue.

    npm install --save @progress/kendo-dropdowntree-vue-wrapper
  3. Import the Kendo UI packages to the App component. If you use the Kendo UI components more than once in your application, add all Kendo UI-related files to the main.js file. If you use the Kendo UI components once in your application, add the Kendo UI-related files the component where they will be referred.

    import '@progress/kendo-ui'
    import '@progress/kendo-theme-default/dist/all.css'
    
    import { DropDownTree, DropDownTreeInstaller } from '@progress/kendo-dropdowntree-vue-wrapper'
    
    Vue.use(DropDownTreeInstaller)
    
    new Vue({
       el: '#app',
       components: {
           DropDownTree
       }
    })

Functionality and Features

Events

The following example demonstrates basic DropDownTree events. You can subscribe to all DropDownTree events by the handler name.

<div id="vueapp" class="vue-app">
    <kendo-dropdowntree :data-source="localDataSource"
                        :filter="'contains'"
                        @dataBound="onDataBound"
                        @change="onChange"
                        @filtering="onFiltering"
                        @open="onOpen"
                        @close="onClose"
                        :placeholder="'Select ...'"
                        style="width: 300px;">
    </kendo-dropdowntree>
</div>
Vue.use(DropDownTreeInstaller);

new Vue({
    el: "#vueapp",
    data: function() {
        return {
            localDataSource: new kendo.data.HierarchicalDataSource({
                data: [{
                    text: 'Furniture',
                    items: [
                        { text: 'Tables & Chairs' },
                        { text: 'Sofas' },
                        { text: 'Occasional Furniture' }
                    ]
                },{
                    text: 'Decor',
                    items: [
                        { text: 'Bed Linen' },
                        { text: 'Curtains & Blinds' },
                        { text: 'Carpets' }
                    ]
                }]
            })
        }
    },
    methods: {
        onDataBound: function (ev) {
            console.log("Event :: dataBound");
        },
        onChange: function (ev) {
            console.log("Event :: change");
        },
        onFiltering: function (ev) {
            console.log("Event :: filtering");
        },
        onOpen: function (ev) {
            console.log("Event :: open");
        },
        onClose: function (ev) {
            console.log("Event :: close");
        }
    }
})
In this article