I have a kendo grid, like this:
so a user can select a periode(periode1) and that is the header.
and this is the javascript for it:
function OngridDatabound(e) { $('.periode1jaar').html($('#Periode1').data('kendoDropDownList').text()); $('.periode2jaar').html($('#Periode2').data('kendoDropDownList').text()); }
and this is the javascript for export naar excel
: $("#export-excel").click(function () { $("#overzicht-grid").data("kendoGrid").saveAsExcel(); })
But if I look in the excel sheet there is still standing in the header periode1 and not for example: januari 2017.
so what to change that the headers of the excel sheet take the correct headers?
Thank you.
I changed like this:
$("#export-excel").click(function () { var grid = $("#overzicht-grid").getKendoGrid(); var rows = [{ cells: [ { value: "Periode 1" } ] }]; var trs = $("#overzicht-grid").find('td'); for (var i = 0; i < trs.length; i++) { } excelExport(rows) function excelExport(rows) { var workbook = new kendo.ooxml.Workbook({ sheets: [ { columns: [ { autoWidth: true }, { autoWidth: true } ], title: "Orders", rows: rows } ] }); kendo.saveAs({ dataURI: workbook.toDataURL(), fileName: "Test.xlsx" }); } })
But now I see again just Periode 1