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>

ligerui_ligerTree_006_ligerui事件支持的更多相关文章

  1. C#事件支持发布者/订阅者模式(观察者模式)

    C#事件支持发布者/订阅者模式,发布者将事件通知给订阅者,而订阅者在事件发生时调用已经注册好的事件处理函数.        public delegate void delUpdate();  //委 ...

  2. 【JavaScript】让事件支持先发布后订阅

    之前写过一个的事件管理器,就是普通的先订阅后发布模式.但实际场景中我们需要做到后订阅的也能收到发布的消息.比如我们关注微信公众号,还是能看到历史消息的.类似于qq离线消息,我先发给你,你登录了就能收到 ...

  3. JS事件 卸载事件 当用户退出页面时(页面关闭、页面刷新等),触发onUnload事件,同时执行被调用的程序。注意:不同浏览器对onunload事件支持不同。

    卸载事件(onunload) 当用户退出页面时(页面关闭.页面刷新等),触发onUnload事件,同时执行被调用的程序. 注意:不同浏览器对onunload事件支持不同. 如下代码,当退出页面时,弹出 ...

  4. 手机端js事件支持(event)

    http://blog.163.com/rex_blog/blog/static/1944801012013102743014369/ 所有被测试的浏览器都支持touchstart.touchend和 ...

  5. IOS中input键盘事件支持的解决方法

    欢迎大家去我的网站详细查看http://genghongshuo.com.cn/ IOS中input键盘事件keyup.keydown.等支持不是很好, 用input监听键盘keyup事件,在安卓手机 ...

  6. 使自定义事件支持多绑定 js

    <script language="JavaScript" type="text/javascript"> <!-- //定义类class1 ...

  7. on绑定事件支持的事件类型

    blurfocusfocusinfocusoutloadresizescrollunloadclickdblclickmousedownmouseupmousemovemouseovermouseou ...

  8. js 判断对touch事件支持

    $.support = (function() { var support = { touch: !!(('ontouchstart' in window) || window.DocumentTou ...

  9. 各浏览器对 onbeforeunload 事件的支持与触发条件实现有差异

    转载:http://www.w3help.org/zh-cn/causes/BX2047 标准参考 无. 问题描述 一般情况下,onbeforeunload 事件处理函数内会写入一些提示性语句,当用户 ...

随机推荐

  1. 定时器的fireDate指的是触发时间

    1.定时器开启后,会在经过设定的时间间隔后才会执行第一次定时操作.而不是立马开启. NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval: ...

  2. Java_Java中动态加载jar文件和class文件

    转自:http://blog.csdn.net/mousebaby808/article/details/31788325 概述 诸如tomcat这样的服务器,在启动的时候会加载应用程序中lib目录下 ...

  3. Linux查看操作系统时间

    date命令的功能是显示和设置系统日期和时间. 该命令的一般格式为: date [选项] 显示时间格式(以+开头,后面接格式) date 设置时间格式 命令中各选项的含义分别为: -d datestr ...

  4. thinkphp多模板布局设置!!

    首先开启模板布局要在配置文件添加: 'LAYOUT_ON'=>true, 'LAYOUT_NAME'=>'layout', 如果需要设置多个布局模板,就要先关闭上面的LAYOUT_ON,也 ...

  5. 使用Font Awesome替换你的网站图标

    http://fortawesome.github.io/Font-Awesome/whats-new/ 使用Font Awesome替换你的网站图标 ******************IE7BUG ...

  6. .net 的 Url 中文加密

    当 Get 的请求参数可能出现中文的时候,那么就需要对其中文进行加密处理: 引用程序集:System.Web 加密方法: HttpUtility.UrlEncode(); 解密方法:HttpUtili ...

  7. php读取指定结束指针文件内容

    fopen操作时文件读取开始指针位于文件开始部分, fseek 以指定文件大小以及开始指针位置确定结束指针位置 具体案例: <?php//打开文件流,fopen不会把文件整个加载到内存$f = ...

  8. BizTalk开发系列(二十六) 使用Web Service

    Web Service是在构建SOA平台中广泛使用的技术.在BizTalk开发过程中使用SOAP适配器接收和发送 Web Services 请求.业务流程可以发布为 Web Services 并使用外 ...

  9. gcc和g++

    一.GCC GNU编译器套件(GNU Compiler Collection)包括C.C++.Objective-C.Fortran.Java.Ada和Go语言的前端,也包括了这些语言的库(如libs ...

  10. Mongo中append方法使用

    在MongoDB的官网已经很详细的介绍了各种客户端的使用,其中也包括java的,在此,仅对几个比较疑惑的地方做个标注: (1).如何向db中添加collection? 如果在api文档中找不到答案,那 ...