Fired when the user clicks the "Export to Excel" toolbar button.
Event Data e.senderkendo.ui.Grid
The widget instance which fired the event.
e.dataArray
The array of data items used to create the Excel workbook. Available since version 2014.3.1205.
e.workbookkendo.ooxml.Workbook
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.preventDefaultWhen the Kendo UI Grid is configured for excel export, the workbook is extended internally with a
fileName
property which is used when the file is saved. The default name is "Export.xlsx". See the example below which shows how to change the name of the exported document.
Function
If invoked the grid will not save the generated file.
Example - subscribe to the "excelExport" event during initialization<div id="grid"></div>
<script>
$("#grid").kendoGrid({
toolbar: ["excel"],
columns: [
{ field: "name" }
],
dataSource: [
{ name: "Jane Doe"},
{ name: "John Doe"}
],
excelExport: function(e) {
e.workbook.fileName = "Grid.xlsx";
}
});
var grid = $("#grid").data("kendoGrid");
grid.saveAsExcel();
</script>
Example - subscribe to the "excelExport" event after initialization
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
toolbar: ["excel"],
columns: [
{ field: "name" }
],
dataSource: [
{ name: "Jane Doe"},
{ name: "John Doe"}
]
});
var grid = $("#grid").data("kendoGrid");
grid.bind("excelExport", function(e) {
e.workbook.fileName = "Grid.xlsx";
});
grid.saveAsExcel();
</script>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4