zoukankan      html  css  js  c++  java
  • ligerui_ligerTree_006_ligerui事件支持

    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('指向某节点_前
     onBeforeSelect:
    ' + note.data.text);
            return true;
        }
        //指向某节点
        function onSelect(note) {
            alert('指向某节点
     onSelect:
    ' + note.data.text);
        }
        //展开前
        function onBeforeExpand(note) {
            alert('展开前
     onBeforExpand
    ' + note.data.text);
        }
        //展开
        function onExpand(note) {
            alert('展开
     onExpand
    ' + note.data.text);
        }
        //折叠前
        function onBeforeCollapse(note) {
            alert('onBeforeCollapse:' + note.data.text);
        }
        //折叠
        function onCollapse(note) {
            alert('折叠
     onCollapse
    ' + note.data.text);
        }
        //选择、取消选择
        function onCheck(note, checked) {
            alert('选择、取消选择
     onCheck
    ' + 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>
  • 相关阅读:
    docker 安装镜像
    Vagrant+Oracle VM VirtualBox创建linux虚拟机(centos7)
    idea配置git,github , gitee
    idea连接数据库
    idea基本设置
    git基础命令
    mybatis中的where
    重学 Java 设计模式:实战桥接模式(多支付渠道「微信、支付宝」与多支付模式「刷脸、指纹」场景)
    HTTPS加密原理
    优惠券数据库设计
  • 原文地址:https://www.cnblogs.com/zjsy/p/4398949.html
Copyright © 2011-2022 走看看