easy_UI
2024-08-22 19:21:17
引入js/css样式
<link rel="stylesheet" type="text/css" href="<%=path%>/easyUI/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyUI/themes/icon.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyUI/css/demo.css">
<script src="<%=path%>/js/jquery-1.8.3.js"></script>
<!--jquery.easyui.min.js包含了easyUI中的所有插件-->
<script src="<%=path%>/js/jquery.easyui.min.js"></script>
编写script
<script>
$(function(){
$('#tree').tree({
url:'basic_tree_data.json', //远程加载tree数据的url路径
animate:true, //是否开启动画效果
checkbox:true, //是否显示复选框
cascadeCheck:false, //是否开启级联选中,checkbox属性为true时才生效
onlyLeafCheck:true, //是否只在叶节点前显示复选框,checkbox属性为true时才生效
dnd:true, //是否启用拖拽功能
onDblClick:function(node){ //鼠标双击事件
$(this).tree("toggle",node.target); //改变当前节点状态
}
});
});
</script>
编写body
<body>
<h2>easy UI Tree</h2>
<ul id="tree"></ul>
</body>
编写basic_tree_data.json
[{
"id":1,
"text":"功能菜单",
"children":[{
"id":11,
"text":"投票管理",
"children":[{
"id":111,
"text":"所有投票",
"attributes":{
"url":"findAll"
},
"iconCls":"icon-search"
},{
"id":112,
"text":"发起投票",
"iconCls":"icon-add"
}]
},
{
"id":12,
"text":"用户管理",
"state":"open",
"children":[{
"id":121,
"text":"个人信息"
},{
"id":122,
"text":"参与投票记录",
"iconCls":"icon-search"
},{
"id":123,
"text":"发起投票记录",
"iconCls":"icon-search"
}]
},{
"id":13,
"text":"系统管理",
"state":"open",
"children":[{
"id":131,
"text":"系统日志"
},{
"id":132,
"text":"数据字典"
}]
}]
}]
实现效果
最新文章
- 中软培训第一周复习总结 --简单的HTML 与CSS
- usb驱动开发14之设备生命线
- Openvswitch原理与代码分析(6):用户态流表flow table的操作
- MFC实现Gif动画制作工具
- js调用百度地图API创建地图,搜索位置
- Java日期处理类
- Code Snippet Library
- LWIP裸机环境下实现TCP与UDP通讯
- 常见的html面试题
- 设计模式的征途—3.抽象工厂(Abstract Factory)模式
- jmeter压测数据库,抓包工具,python基础
- IDEA配置github并上传项目
- Redis 保护模式
- 一、Sql Server 基础培训《进度1-建库建数据表(实际操作)》
- 如何相互转换逗号分隔的字符串和List【转】
- Examples of GoF Design Patterns in Java&#39;s core libraries
- [转载]Oracle左连接、右连接、全外连接以及(+)号用法
- centos7-jdk快速安装
- BZOJ2322 [BeiJing2011]梦想封印 【set + 线性基】
- Android调用Webservice发送文件
热门文章
- [SQL] SQL 基础知识梳理(三) - 聚合和排序
- spring aop
- React.js深入学习详细解析
- 读书笔记--SQL必知必会15--插入数据
- Android面试一天一题(1Day)
- reStructuredText(rst)快速入门语法说明
- 使用Adminlite + ASP.NET MVC5(C#) + Entityframework + AutoFac + AutoMapper写了个api接口文档管理系统
- 设计模式(九)装饰者模式(Decorator Pattern)
- Xcode7.1环境下上架iOS App到AppStore 流程① (Part 一)
- spring/spring boot/spring cloud开发总结