ligerui:ligerTree事件支持:

源码地址:http://download.csdn.net/detail/poiuy1991719/8571255

效果图:

代码:json.txt

[
{ text: '节点1', children: [
{ text: '节点1.1' },
{ text: '节点1.2' },
{ text: '节点1.3', children: [
{ text: '节点1.3.1' ,children: [
{ text: '节点1.3.1.1' },
{ text: '节点1.3.1.2' }]
},
{ text: '节点1.3.2' }
]
},
{ text: '节点1.4' }
]
},
{ text: '节点2' },
{ text: '节点3' },
{ text: '节点4' }
]

代码:HTML

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<title>事件支持</title>
<!-- 1:引入文件 -->
<script src="lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<link href="lib/ligerUI/skins/Aqua/css/ligerui-tree.css"
rel="stylesheet" type="text/css" />
<script src="lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script> <script type="text/javascript">
//加入ligerTree、配置事件属性
var manager = null;
$(function() {
$("#tree1").ligerTree({
url : 'json.txt',
onBeforeExpand : onBeforeExpand,
onExpand : onExpand,
onBeforeCollapse : onBeforeCollapse,
onCollapse : onCollapse,
onBeforeSelect : onBeforeSelect,
onSelect : onSelect,
onCheck : onCheck
});
}); //3:重写事件方法
//指向某节点前
function onBeforeSelect(note) {
alert('指向某节点_前\n onBeforeSelect:\n' + note.data.text);
return true;
}
//指向某节点
function onSelect(note) {
alert('指向某节点\n onSelect:\n' + note.data.text);
}
//展开前
function onBeforeExpand(note) {
alert('展开前\n onBeforExpand\n' + note.data.text);
}
//展开
function onExpand(note) {
alert('展开\n onExpand\n' + note.data.text);
}
//折叠前
function onBeforeCollapse(note) {
alert('onBeforeCollapse:' + note.data.text);
}
//折叠
function onCollapse(note) {
alert('折叠\n onCollapse\n' + note.data.text);
}
//选择、取消选择
function onCheck(note, checked) {
alert('选择、取消选择\n onCheck\n' + note.data.text + " checked:" + checked);
}
</script>
</head>
<body>
事件支持:
<br>
<div>
<ul id="tree1">
</ul>
</div>
<div style="display:none"></div>
<a href="index7.jsp">下一效果:</a>
</body>
</html>

最新文章

  1. C# webBrowser控件禁用alert,confirm之类的弹窗解决方案
  2. Australian troops to the fight against Islamic State militants.
  3. Web调试利器OpenWindow
  4. Android Studio 中 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task &#39;:compileDebugAidl&#39;.的问题解答
  5. AC日记——阶乘之和 洛谷 P1009(高精度)
  6. nginx 反向代理 google
  7. 1502: [NOI2005]月下柠檬树 - BZOJ
  8. MyBatis的动态SQL操作--插入
  9. gnome中文翻译之po
  10. AngularJS - 基本功能介绍
  11. Java 多线程异步处理demo
  12. xxe漏洞检测及代码执行过程
  13. asp.net core系列 42 Web 应用 分部视图
  14. ntp服务问题
  15. IdentityServer4 接口说明
  16. this.class.getClassLoader().getResourceAsStream与this.class.getResourceAsStream 文件地址获取
  17. django初体验 学习笔记
  18. 多线程-threading
  19. centos7安装zookeeper3.4.9集群
  20. UIScrollView视差效果动画

热门文章

  1. thinkphp遗留问题
  2. spring源码学习之路---IOC容器初始化要义之bean定义载入(五)
  3. python基础学习——第二天
  4. github仓库的克隆、修改、上传方法(图)
  5. MySQL数据库基本数据类型
  6. Eclipse上的项目分享到GitHub
  7. 从客户端(Content=&quot;&lt;p&gt;SF&lt;/p&gt;&quot;)中检测到有潜在危险的 Request.Form 值
  8. linux笔记十----虚拟机网络配置
  9. spring security方法一 自定义数据库表结构
  10. scrum站立会议学习