1 Star 0 Fork 1

20a20/Easyui框架-右键拷贝+datagrid导出为xlsx文件

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index-copy.html 2.73 KB
一键复制 编辑 原始数据 按行查看 历史
XUSHIJIE 提交于 2021-12-23 13:17 +08:00 . first commit
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Easyui右键copy功能练习</title>
<link rel="stylesheet" href="./easyui/themes/default/easyui.css" />
<link rel="stylesheet" href="./easyui/themes/icon.css" />
<script src="./easyui/jquery.min.js"></script>
<script src="./easyui/jquery.easyui.min.js"></script>
</head>
<body>
<table id="tt" class="easyui-datagrid">
<thead>
<tr>
<th data-options="field:'code'">编码</th>
<th data-options="field:'name'">名称</th>
<th data-options="field:'qita'">其他</th>
<th data-options="field:'price'">价格</th>
</tr>
</thead>
<tbody>
<tr>
<td>001</td>
<td>名称1</td>
<td>为的撒旦\n为为</td>
<td>2323</td>
</tr>
<tr>
<td>002</td>
<td>名称2</td>
<td></td>
<td>4612</td>
</tr>
<tr>
<td>002</td>
<td>名称2</td>
<td>ewqew</td>
<td>4613</td>
</tr>
</tbody>
</table>
<button id="change">改变</button>
<script>
$("#change").click(function () {
$("#tt").datagrid({
nowrap: false,
columns: [
[
{ field: "id", title: "id" },
{ field: "text", title: "text",width:80, },
],
],
data: data,
onRowContextMenu: function (e, index, row) {
onRowContextMenu_Copy.call(this, e, index, row);
},
});
});
let data = [
{
id: 1,
text: `1、任务
2、管理
3、其他`,
},
{
id: 2,
text: "得瑟得瑟",
},
];
$("#tt").datagrid({
nowrap: true,
rownumbers: true,
onRowContextMenu: function (e, index, row) {
onRowContextMenu_Copy.call(this, e, index, row);
},
});
</script>
<script src="./copyEasyuiDatagridToClipboard.js"></script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/a20a20/easyui-ExpandFunc.git
git@gitee.com:a20a20/easyui-ExpandFunc.git
a20a20
easyui-ExpandFunc
Easyui框架-右键拷贝+datagrid导出为xlsx文件
master

搜索帮助