zoukankan      html  css  js  c++  java
  • 12、jquery的tree组件

    1、

     <!--jquery 的主文件...-->
        <script type="text/javascript" src="../../js/jquery.min.js"></script>
        <!--jquery  easyui 的主文件...-->
        <script type="text/javascript" src="../../js/jquery.easyui.min.js"></script>
        <!--jQuery 的主样式文件...
        <link type="text/css" rel="stylesheet" href="../../js/themes/default/easyui.css">
        -->
        
        <link type="text/css" rel="stylesheet" href="../../js/themes/bootstrap/easyui.css">
        <!--jQuery 的图标文件...-->
        <link type="text/css" rel="stylesheet" href="../../js/themes/icon.css">
        <script type="text/javascript" src="../../js/locale/easyui-lang-zh_CN.js"></script>
    
        <script type="text/javascript">
            
                $(function(){
                    
                     $("#easyUITree").tree({
                             url:"treedata.json",
                            dnd:true,
                            animate:true,
                            checkbox:true,
                            lines:true,
                            onClick:function(node){
                                //alert(node.text);
                                //控制台打印
                                //console.info(node);
                                //$("#easyUITree").tree("getChildren",node)
                                var children=node.children;
                                alert(children.length)
                            }
                     })
                    
                    
                })
            
            
            
        </script>
    
      </head>
      
      <body>
            <ul id="easyUITree">
            </ul>
      </body>

    treedata.json

    [
        {
            "id":1,
            "text":"北京市传智播客教育有限公司",
            "iconCls":"icon-add",    
            "children":[
                {
                    "id":3,
                    "text":"高教产品研发部"
                },{
                    "id":4,
                    "text":"战略规范部"
                }
            ]
        },{
            "id":2,
            "text":"北京市黑马程序员",
            "children":[
                {
                    "id":5,
                    "text":"java 教研部"
                },{
                    "id":6,
                    "text":"IOS 教研部"
                }
                ,{
                    "id":7,
                    "text":"美女学工部"
                }
            ]
        }
    
    ]

    2、window弹出框

    <!--jquery 的主文件...-->
        <script type="text/javascript" src="../../js/jquery.min.js"></script>
        <!--jquery  easyui 的主文件...-->
        <script type="text/javascript" src="../../js/jquery.easyui.min.js"></script>
        <!--jQuery 的主样式文件...-->
        <link type="text/css" rel="stylesheet" href="../../js/themes/default/easyui.css">
        <!--jQuery 的图标文件...-->
        <link type="text/css" rel="stylesheet" href="../../js/themes/icon.css">
        
        <script type="text/javascript" src="../../js/locale/easyui-lang-zh_CN.js"></script>
        <!--直接找图标的网站... www.iconfinder.com-->
        
        <script type="text/javascript">
              $(function(){
                      $("#btn").click(function(){
                            $("#window").window({
                                    title:"搜索",
                                    height:300,
                                    200,
                                    //modal:true
                            })
                        
                        
                        
                    })
                    
                    
                    $("#btn-1").click(function(){
                                    $.messager.confirm('确认','您确认想要退出系统吗?',function(r){    
                                        if (r){    
                                            alert('确认删除');    
                                        }    
                                    });  
                    })
                    
                    
                    $.messager.show({
                        title:'我的消息',
                        msg:'消息将在5秒后关闭。',
                        timeout:5000,
                        350,
                        height:200,
                        showType:'slide'
                    });
    
              })
            
            
            
        </script>
        
      </head>
      
      <body>
                  <!--把按钮渲染在这个a 标签上面... -->
                <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">搜索</a>
                <div id="window"></div>
                  <div style="float:right">
                    <a id="btn-1" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">退出系统</a>
                  </div>
      </body>

    3、jQueryEasyUI的配置

  • 相关阅读:
    【马化腾如何工作】
    NOKIA格机方法
    C和C++资源
    JSP/Servlet 中的汉字编码问题
    好听力网站
    GRE单词法
    Visual Studio 2008的一些小技巧
    从键盘输入一个字符串,将其中的大写字母变小写字母,小写字母变大写字母,并输出 。
    中图文分类号 TP自动化技术、计算机技术
    保护您眼睛视力 对Win7/Vista/XP作如下设置
  • 原文地址:https://www.cnblogs.com/weizhen/p/5851696.html
Copyright © 2011-2022 走看看