We recently uprevved to the 2024.2.514 version of kendo ui and there appears to be a defect with manually handling the export excel event from a grid. We need to be able to show a hidden column so it appears in the export, then hide it again.
Previously we were able to call e.preventDefault, show the column, and call e.sender.saveAsExcel() before hiding the column and it worked. Now when we do this the "exporting ..." overlay remains. If I use jquery to remove the overlay the export button does not work when clicked a second time.
Our example is in razor and actually functions better than this jquery example below which doesn't even save the file.
https://dojo.telerik.com/oMEpuDAY
In other words the following code from https://docs.telerik.com/kendo-ui/knowledge-base/grid-include-hidden-columns-in-excel-export doesn't work anymore.
var exportFlag = false;
$("#grid").data("kendoGrid").bind("excelExport", function (e) {
if (!exportFlag) {
e.sender.showColumn(1);
e.preventDefault();
exportFlag = true;
setTimeout(function () {
e.sender.saveAsExcel();
});
} else {
e.sender.hideColumn(1);
exportFlag = false;
}
});