Edit this page

excelExport

Fired when the user clicks the "Export to Excel" toolbar button.

Event Data

e.sender kendo.ui.TreeList

The widget instance which fired the event.

e.data Array

The array of data items used to create the Excel workbook. Available since version 2014.3.1205.

e.workbook Object

The Excel workbook configuration object. Used to initialize a kendo.ooxml.Workbook class. Modifications of the workbook will reflect in the output Excel document.

e.preventDefault Function

If invoked the treelist will not save the generated file.

Example - subscribe to the "excelExport" event during initialization

<div id="treeList"></div>
<script>
  $("#treeList").kendoTreeList({
    toolbar: ["excel"],
    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 }
    ],
    excelExport: function(e) {
      e.workbook.fileName = "Employees.xlsx";
    }
  });
  var treeList = $("#treeList").data("kendoTreeList");
  treeList.saveAsExcel();
</script>

Example - subscribe to the "excelExport" event after initialization

<div id="treeList"></div>
<script>
  $("#treeList").kendoTreeList({
    toolbar: ["excel"],
    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 }
    ],
    excelExport: function(e) {
      e.workbook.fileName = "Employees.xlsx";
    }
  });
  var treeList = $("#treeList").data("kendoTreeList");
  treeList.bind("excelExport", function(e) {
    e.workbook.fileName = "Employees.xlsx";
  });
  treeList.saveAsExcel();
</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