pdfExport

Fires when the user clicks the Export to PDF toolbar button.

Event Data

e.sender kendo.ui.TreeList

The widget instance which fired the event.

e.preventDefault Function

If invoked, the TreeList will not save the generated file.

e.promise Promise

A promise that will be resolved when the export completes.

Example - subscribing to the pdfExport event during initialization

<div id="treeList"></div>
<script>
  $("#treeList").kendoTreeList({
    toolbar: ["pdf"],
    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 }
    ],
    pdfExport: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
      console.log("exporting PDF");
    }
  });
  var treelist = $("#treeList").data("kendoTreeList");
  treelist.saveAsPDF();
</script>

Example - subscribing to the pdfExport event after initialization

<div id="treeList"></div>
<script>
  $("#treeList").kendoTreeList({
    toolbar: ["pdf"],
    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("pdfExport", function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log("exporting pdf");
  });
  treelist.saveAsPDF();
</script>
In this article