| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2520 人关注过本帖
标题:jsp页面中树状图的tree.expandAll()的用法
只看楼主 加入收藏
SoftWarezx
Rank: 1
等 级:新手上路
威 望:1
帖 子:47
专家分:9
注 册:2010-7-14
结帖率:100%
收藏
 问题点数:0 回复次数:1 
jsp页面中树状图的tree.expandAll()的用法
如题,做了一个树状图,客户要求要将树状图默认打开状态,从网上只搜了个expan
程序代码:
<%@ page language="java" pageEncoding="utf-8"%>
<%@ page import="com.sinosoft.util.tool.*"%>
<%@ taglib prefix="h" uri="/WEB-INF/sinoEP.tld"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <%
            String contextPath = request.getContextPath();
             String modelID= ParamUtils.getStringParameter(request, "modelID","");
             String con    = "contextmenu1#contextmenu2#contextmenu3#contextmenu";
              String han  = "delet#adds#addsa";
          %>
        <title>
           
        </title>
        <META NAME="author" CONTENT="majianwei">
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=gb2312">
        <link rel="stylesheet" href="<%=contextPath%>/css/blue/css_9.css">
        <script type="text/javascript" src="../treetest.js"></script>
    </head>
    <h:base basePath="<%=contextPath %>" theme="xtheme-green">
    <script type="text/javascript">
       //移动节点后运行此方法
           function afterMoveNode(e){
               alert(e.dropNode.text+"---->"+e.target.text+"==="+e.point);
           }
          
           //相应单击
           function extTreeOnclick(node){
           var node = tree.getNode(node);
           var srcUrl = node.attributes.url;
           var root_id="<%=modelID%>";
           var right_div =parent.document.getElementById("div_right");
           var value= node.attributes.name;
           var srcID=node.attributes.id;
             if(srcUrl==null||srcUrl=="null"||srcUrl==""){
            //parent.rightframe.location="/jsp/indexpage/tips.jsp?node_name="+value;
             right_div.innerHTML="<iframe src='<%=contextPath %>/jsp/indexpage/tips.jsp?node_name="+value+"' width='100%' height='100%' frameBorder='0' scrolling='auto' marginwidth='0' marginheight='0'></iframe>";
            }else{
                    if(srcUrl.indexOf("?")>=0){
                       
                    //  parent.rightframe.location=srcUrl+"&model_id="+srcID
                        right_div.innerHTML="<iframe src="+srcUrl+"&model_id="+srcID+" width='100%' height='100%' frameBorder='0' scrolling='auto' marginwidth='0' marginheight='0'></iframe>";
                    }else{
                       
                    // parent.rightframe.location=srcUrl+"?model_id="+srcID;
                        right_div.innerHTML="<iframe src="+srcUrl+"?model_id="+srcID+" width='100%' height='100%' frameBorder='0' scrolling='auto' marginwidth='0' marginheight='0'></iframe>";
                    }
            }
        }
          
           //查询节点时运行此方法
           function query(){
               var tree = findObj("trees");
               var str = document.getElementById("text").value;
            find(tree,'/sinoEP/del.bigPage?clazz=dev.tags.text.GetTreeId&&name='+str);
           }
       
        //进行节点拖拽时运行此方法
           function overMoveNode(e){
               if(e.target.attributes.eq=="4"){
                   return false;
               }else{
                   return true;
               }
         }
        var right_div =parent.document.getElementById("div_right");
        right_div.innerHTML="<iframe src='<%=contextPath%>/jsp/indexpage/tips.jsp?node_name=<%="模块名称,modelID="+modelID%>' width='100%' height='100%' frameBorder='0' scrolling='no' marginwidth='0' marginheight='0'></iframe>";
   </script>
   <script type="text/javascript" src="<%=contextPath%>/js/ComboBoxTree/ComboBoxTree.js"></script>
   <style>
        .x-tree-node-leaf .x-tree-node-icon {
            background-image:
                url(<%=contextPath%>/js/resources/images/default/tree/folder.gif);
        }

        .x-tree .x-panel-body {
            background-color: #ecf5ff;
        }
    </style>
        <body class="bodyleft">
            <TABLE width="100%" height="100%" border="0" align="center"
                cellPadding="0 " cellSpacing="0">
                <TR>
                    <TD width="100%" height="1" vAlign="top">
                        <TABLE cellSpacing="0" cellPadding="0 " width="100%" border="0">
                            <TBODY>
                                <TR>
                                    <TD width="130" height="18" align="center"
                                        background="<%=contextPath%>/images/blue/l_bgs1.gif"
                                        class="fontblack">
                                        请选择相关功能
                                    </TD>
                                </TR>
                            </TBODY>
                        </TABLE>
                    </TD>
                </TR>

                <tr>
                    <td valign="top" class="tabtdbg5">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <!-- 异步加载 -->
                                    <h:Tree  asy="true" rootMenuVisible="true"
                                        asyclazz="com.sinosoft.module.system.tree.ExtModelTree" height="600" width="200"
                                        border="false" click="extTreeOnclick" loadid="ha" rootId="<%=modelID%>" rootName="系统管理"
                                        rootVisible="true"
                                        treeid="qqq"
                                        treeMenuHandlers="<%=han %>" url="/a.bigPage?sss=1"
                                        id="trees" params=""
                                        autoScroll="false" nodedrop="afterMoveNode"
                                        nodedragover="overMoveNode" />
                                    
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </body>
    </h:base>
</html>
dAll()方法,会用的说下,谢谢了!
搜索更多相关主题的帖子: tree expandAll jsp 用法 页面 
2010-10-14 14:04
SoftWarezx
Rank: 1
等 级:新手上路
威 望:1
帖 子:47
专家分:9
注 册:2010-7-14
收藏
得分:0 
以后不来 bccn了,伤心。。。。。
2010-10-19 13:37
快速回复:jsp页面中树状图的tree.expandAll()的用法
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.029244 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved