<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery treetable</title>
<link rel="stylesheet" href="treetable/jquery.treetable.css" />
<script src="treetable/jquery.js"></script>
<script src="treetable/jquery-ui.js"></script>
<script src="treetable/jquery.treetable.js"></script>
<script>
$(document).ready(function(){
var heads = ["name","td1","td2"];
var tNodes = [
{ id: 1, pId: 0, name: "父节点1", td: ["parent", "1"] },
{ id: 11, pId: 1, name: "父节点11", td: ["<a href='javascript:void(0);' onclick=\"alert('内容为html');\">parent</a>", "11"] },
{ id: 111, pId: 11, name: "叶子节点111", td: ["children", "111"] },
{ id: 112, pId: 11, name: "叶子节点112", td: ["children", "112"] },
{ id: 113, pId: 11, name: "叶子节点113", td: ["children", "113"] },
{ id: 114, pId: 11, name: "叶子节点114", td: ["children", "114"] },
{ id: 12, pId: 1, name: "父节点12", td: ["parent", "12"] },
{ id: 121, pId: 12, name: "叶子节点121", td: ["children", "121"] },
{ id: 122, pId: 12, name: "叶子节点122", td: ["children", "122"] },
{ id: 123, pId: 12, name: "叶子节点123", td: ["children", "123"] },
{ id: 124, pId: 12, name: "叶子节点124", td: ["children", "124"] },
{ id: 2, pId: 0, name: "父节点2", td: ["parent", "2"] },
{ id: 21, pId: 2, name: "父节点21", td: ["parent", "21"] },
{ id: 211, pId: 21, name: "叶子节点211", td: ["children"] },
{ id: 212, pId: 21, name: "叶子节点212", td: ["children", "212"] },
{ id: 213, pId: 21, name: "叶子节点213", td: ["children", "213"] },
{ id: 214, pId: 21, name: "叶子节点214", td: ["children"] }
];
$.TreeTable("treeMenu", heads, tNodes);
});
</script>
</head>
<body>
<div id="main">
<h1>jQuery treetable</h1>
<a href="#" onclick="jQuery('#treeMenu').treetable('expandAll'); return false;">Expand all</a>
<a href="#" onclick="jQuery('#treeMenu').treetable('collapseAll'); return false;">Collapse all</a>
<table id="treeMenu" class="linetable">
</table>
</div>
</body>
</html>
Jquery TreeTable及示例,仿zTree绑定数据方式,亲测能用
5星 · 超过95%的资源 需积分: 10 116 浏览量
2018-01-06
09:02:54
上传
评论
收藏 117KB ZIP 举报
changrui
- 粉丝: 5
- 资源: 3
最新资源
- Wireshark-4.2.4-x64.exe
- Video DownloadHelper需要的合作应用VdhCoApp 2.0.19
- Screenshot_2024-04-20-16-26-41-628_com.tencent.mm-edit.jpg
- 基于python+YOLOV7与DeepLabv3+图像深度学习算法+车载摄像头道路识别+语音告知车道偏离、前后方车距等辅助驾驶
- SpringBoot项目2.6.6版本基础框架
- CursorAI编程和软件开发.txt
- C语言编写的学生管理系统,由多个 .c 文件和 .h文件组成 我用的是VSCode软件编写的
- API开发工具.txt
- python源码超级画板程序
- AI智能将图片转换成HTML和CSS代码.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈