collapse

Triggered before a node has been collapsed upon user interaction. Preventable.

Event Data

e.sender kendo.ui.OrgChart

The OrgChart instance that triggered the event.

e.item jQuery

The parent item element that is about to be collapsed. In grouped scenario contains all elements that belong to the group which children are about to be collapsed.

e.dataItems Array

The data items of the nodes that are about to change their expanded value.

e.preventDefault Function

If invoked prevents collapsing.

Example

<div id="orgchart"></div>

<script>
    $("#orgchart").kendoOrgChart({
        dataSource: [
            { id: 1, name: "Jane", title: "Boss", expanded: true },
            { id: 2, name: "John", title: "Lead", expanded: true, parentId: 1 },
            { id: 3, name: "Jill", title: "Worker", expanded: true, parentId: 2 },
            { id: 4, name: "James", title: "Worker", expanded: true, parentId: 2 },
        ],
        collapse: function(e) {
            e.preventDefault();
        }
    });
</script>
In this article