jQuery MiniUI

 找回密码
 立即注册
查看: 3598|回复: 5
打印 上一主题 下一主题

使用tree标签和tab标签联系,出现重复 [复制链接]

Rank: 2

跳转到指定楼层
楼主
发表于 2014-3-14 14:10:04 |只看该作者 |倒序浏览
页面分成两块,左边是树状标签,右边是tab标签,现在使用的结果就是tab默认的页面的打开出现了重复,不是默认的页面不会出现重复打开的情况

Rank: 8Rank: 8

沙发
发表于 2014-3-14 14:16:25 |只看该作者
http://www.miniui.com/demo/outlooktree/outlooktree.html
参考这个示例做。
还有你的问题的描述的不是很清楚?你具体要做什么?

Rank: 2

板凳
发表于 2014-3-14 14:32:42 |只看该作者
lost 发表于 2014-3-14 14:16
http://www.miniui.com/demo/outlooktree/outlooktree.html
参考这个示例做。
还有你的问题的描述的不是很 ...

我就是参照这个做的,出现的页面切换,其中有一个是重复的

Rank: 8Rank: 8

地板
发表于 2014-3-14 14:53:31 |只看该作者
yiyeputi 发表于 2014-3-14 14:32
我就是参照这个做的,出现的页面切换,其中有一个是重复的

是不是树节点和tabs对应的页面名称重复了,所有会出现一个页面重复。
你仔细看下你的节点和对应页面的名称。
如果还是有问题请把出现问题的html示例打包上传。我们看下

Rank: 2

5#
发表于 2014-3-14 15:09:03 |只看该作者
lost 发表于 2014-3-14 14:53
是不是树节点和tabs对应的页面名称重复了,所有会出现一个页面重复。
你仔细看下你的节点和对应页面的名 ...
代码那个地方是没有重复的<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
        <head>
                <title>myindex.html</title>
                <link href="../demo/demo.css" rel="stylesheet" type="text/css" />
                <!--  <script src="../../minijs/index.js" type="text/javascript">-->
</script>
                <script src="../scripts/boot.js" type="text/javascript">
</script>
                <script type="text/javascript">
</script>
                <style type="text/css">
body {
        margin: 0;
        padding: 0;
        border: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
}

.header {
        background: url(../header.gif) repeat-x 0 -1px;
}
</style>
        </head>
        <!-- 加载f()方法 -->
        <body>

                <div id="layout1" class="mini-layout"
                        style="width: 100%; height: 100%;">

                        <div class="header" region="north" height="34" showSplit="false"
                                showHeader="false">
                                <table width="96%">
                                        <tr>
                                                <td width="25%">

                                                </td>
                                                <td align=left width="35%">
                                                        <img src="../images/6.jpg" width="600px" height="20px">
                                                        <!--  <img src="../images/xws_title.jpg" >   -->


                                                </td>
                                                <td width="7%" align="left">
                                                        

                                                </td>
                                                <td width="10%">
                                                        
                                                </td>
                                                <td align="left" width="20%">
                                                         
                                                </td>
                                        </tr>


                                </table>
                        </div>
                        
                        <div title="center" region="center" bodyStyle="overflow:hidden;">
                                <!--Splitter-->
                                <div class="mini-splitter" style="width: 100%; height: 100%;"
                                        borderStyle="border:0;">
                                        <!--OutlookTree-->
                                        <div size="180" maxSize="250" minSize="100"
                                                showCollapseButton="true" style="border: 0;">
                                                
                                                <div id="leftTree" class="mini-outlooktree"
                                                        url="../TreeController/getTree.do"
                                                        textField="text" idField="id" parentField="pid">
                                                </div>
                                        </div>

                                        <div showCollapseButton="false" style="border: 0;">
                                                <!--Tabs-->
                                                <div id="mainTabs" class="mini-tabs" activeIndex="2"
                                                        style="width: 100%; height: 100%;" plain="true">
                                                        <!--                                                        <div title="证书查询"-->
                                                        <!--                                                                url="../pagesarch.html">-->
                                                </div>
                                        </div>

                                </div>
                        </div>
                </div>
                <script type="text/javascript">
mini.parse();
var tree = mini.get("leftTree");
var skin = mini.Cookie.get("miniuiSkin");
if (skin) {
        var selectSkin = document.getElementById("selectSkin");
        selectSkin.value = skin;
} else {
        onSkinChange('blue');
}

function sd(){
window.location
}
var tree = mini.get("leftTree");
function showTab(node) {
        var tabs = mini.get("mainTabs");
        var id = "tab$" + node.id;
        //添加注销
        if ("tab$133" == id) {
                mini.open( {
                        url : bootPATH + "../pages/page.html",
                        title : "注销",
                        width : 250,
                        height : 180
                });
        } else {
                var tab = tabs.getTab(id);
                if (!tab) {
                        tab = {};
                        tab.name = id;
                        tab.title = node.text;
                        tab.showCloseButton = true;
                        //这里拼接了url,实际项目,应该从后台直接获得完整的url地址
                        //tab.url = mini_JSPath + "../../docs/api/" + node.id + ".html";
                        //tab.url = mini_JSPath + "../../pages/search.html";        
                        tab.url = mini_JSPath + "../../" + node.url;
                        tabs.addTab(tab);
                }
                tabs.activeTab(tab);
        }
}
function onNodeSelect(e) {
        var node = e.node;
        var isLeaf = e.isLeaf;

        if (isLeaf) {
                showTab(node);
        }
}
//设置默认页面
function f() {
        var tabs = mini.get("mainTabs");
        var tab = tabs.getTab('tab$111');
        if (!tab) {
                tab = {};
                tab.name = 'tab$111';
                tab.title = "备案查询";
                tab.showCloseButton = true;
                tab.url = mini_JSPath + "../../pages/applySearch.jsp";
                tabs.addTab(tab);
        }
        loginIsno();
        tabs.activeTab(tab);
}
function onClick(e) {
        var text = this.getText();
        alert(text);
}
function onQuickClick(e) {
        tree.expandPath("datagrid");
        tree.selectNode("datagrid");
}

function shift(type) {
        var types;
        types = type;
        if (types == '1') {
                types = "zh_CN"
        } else if (types == '2') {
                types = "en_US"
        }
        var url = "../InternationalizationControl/InternationalShift.do?type="
                        + types;
        $.ajax( {
                url : url,
                type : "get",
                success : function(text) {
                window.location.href = "../pages/index.jsp";
        }
        });

}

function onSkinChange(skin) {
        mini.Cookie.set('miniuiSkin', skin, 100);//100天过期的话,可以保持皮肤切换
        window.location.reload()
}
function loginIsno(){
window.location.href="../LoginController/loginIsnot.do";
}

</script>
        </body>

</html>

Rank: 8Rank: 8

6#
发表于 2014-3-14 15:31:06 |只看该作者
yiyeputi 发表于 2014-3-14 15:09
代码那个地方是没有重复的


页面出现重复,肯定是你给的页面的地址错误导致的
断点调试当你点击那个出现重复页的节点的时候,给的页面页面地址为什么会错

Archiver|普加软件

GMT+8, 2024-9-29 11:30 , Processed in 1.045774 second(s), 10 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部