Kendo saveasexcel dynamically header of excel sheet

匿名 (未验证) 提交于 2019-12-03 09:06:55

问题:

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!