gpt4 book ai didi

kendo-ui - Kendo UI Grid 导出到 Excel 不起作用

转载 作者:行者123 更新时间:2023-12-05 08:26:14 25 4
gpt4 key购买 nike

我遇到过类似的问题,为什么我的 excel 导出按钮不起作用?它有什么问题。感谢您的帮助。

$("#grid").kendoGrid({
toolbar: ["create", "excel", "pdf"],
excel: {
fileName: "Test.xlsx",
allPages: true
},
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: {
data: [
{ id: 1, name: "Jane Doe", age: 30 },
{ id: 2, name: "John Doe", age: 33},
],
schema: {
model: { id: "id" }
}
},
editable: true
});
.k-grid-toolbar {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
}

.k-grid-toolbar .k-grid-excel {
margin-left: auto;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Kendo UI Snippet</title>

<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.common.min.css"/>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.rtl.min.css"/>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.silver.min.css"/>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.1.220/styles/kendo.mobile.all.min.css"/>

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2019.1.220/js/kendo.all.min.js"></script>


</head>
<body>

<div id="grid"></div>

</body>
</html>

最佳答案

如果您检查过浏览器的控制台,您会发现 Kendo 遗漏了一些库。 “要充分利用 Excel 导出功能,请下载 JSZip 库并将该文件包含在 Kendo UI JavaScript 文件之前,如下所示”:https://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements

关于kendo-ui - Kendo UI Grid 导出到 Excel 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55584442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com