Edit this page

expand

Fired when an item is about to be expanded.

The event handler function context (available via the this keyword) will be set to the widget instance.

Event Data

e.sender kendo.ui.TreeList

The widget instance which fired the event.

e.model kendo.data.TreeListModel

The data item to which the table row is bound.

e.preventDefault Function

If invoked prevents the expand action. The child table rows will not be shown.

Example - subscribe to the "expand" event before initialization

<div id="treeList"></div>
 <script>
    $("#treeList").kendoTreeList({
      columns: [
        { field: "Name" },
        { field: "Position" }
      ],
      dataSource: [
        { id: 1, Name: "Daryl Sweeney", Position: "CEO", parentId: null },
        { id: 2, Name: "Guy Wooten", Position: "Chief Technical Officer", parentId: 1 }
      ],
      expand: function(e) {
        console.log("expand");
      }
    });
</script>

Example - subscribe to the "expand" event after initialization

<div id="treeList"></div>
<script>
  function expand(e) {
    console.log("expand");
  }
  $("#treeList").kendoTreeList({
    columns: [
      { field: "Name" },
      { field: "Position" }
    ],
    dataSource: [
      { id: 1, Name: "Daryl Sweeney", Position: "CEO", parentId: null },
      { id: 2, Name: "Guy Wooten", Position: "Chief Technical Officer", parentId: 1 }
    ]
  });

  var treeList = $("#treeList").data("kendoTreeList");
  treeList.bind("expand", expand);
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy