我是教自己为剑道网格,无法找到例子或演示导出pdf和excel到不同的目录,然后下载文件夹。当前,当我按下“导出到excel”和“导出到pdf”的按钮时,我的代码会自动下载导出的文件到“下载”文件夹。
我尝试过"saveAs()“,但这不是我想要的函数。这是我的密码。
toolbar: ["create", "excel", "pdf"],
excel: {
fileName: "Kendo UI Grid Export.xlsx",
filterable: true
},
pdf: {
allPages: true,
avoidLinks: true,
paperSize: "A4",
margin: { top: "2cm", left: "1cm", right: "1cm", bottom: "1cm" },
landscape: true,
repeatHeaders: true,
template: $("#page-template").html(),
scale: 0.8
},发布于 2019-09-20 06:31:02
出于安全原因,您无法访问本地文件夹。因此,不可能针对您的导出本地文件夹。考虑到您正在学习,Kendo还有一些有趣的特性,用于保存文件(服务器端)。这里
这里有一个例子
var dataURI = "data:text/plain;base64,SGVsbG8gV29ybGQh";
kendo.saveAs({
dataURI: dataURI,
fileName: "test.txt",
proxyURL: "/path/to/proxy",
forceProxy: true
});https://stackoverflow.com/questions/58019106
复制相似问题