- 注册时间
- 2014-4-14
- 最后登录
- 2014-4-29
- 阅读权限
- 10
- 积分
- 26
- 精华
- 0
- 帖子
- 3
|
使用removeAll无法关闭全部标签页,只关闭了当前页和后面的页面点击关闭:
效果:
如果只有两页面的话就能全关闭,目标效果是1次关闭全部标签页
代码如下:
<%@ page language="java" pageEncoding="GBK"%>
<%
String contextPath=request.getContextPath();
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>1号</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="<%=contextPath%>/htwyRes/miniui/scripts/boot.js" type="text/javascript"></script>
<link href="<%=request.getContextPath() %>/htwyRes/miniui/scripts/miniui/themes/blue2003/skin.css" rel="stylesheet" type="text/css" />
<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>
<link href="<%=request.getContextPath() %>/htwyRes/orderNew/css/main.css" rel="stylesheet" type="text/css" />
</head>
<body style="background-color: #DEF0FE">
<input type="hidden" id="basePath" value="<%=basePath %>" />
<input type="hidden" id="paths" value="<%=path %>" />
<!--Layout-->
<div id="layout1" class="mini-layout" style="width:100%;height:100%;">
<div class="header" region="north" height="70" showSplit="false" showHeader="false" >
<h1 style="margin:0;padding:15px;cursor:default;display: none;">平台</h1>
<div style="position:absolute;left: 10px;margin-top: 12px"><img src="images/bbbhead_title.png;" /></div>
<div style="position:absolute;margin-top: 20px;right:250px;display: none;"> 搜索:<input /></div>
<!-- 右上角 -->
<div style="position:absolute;top:18px;right:10px;">
<a class="mini-button" iconCls="top_right_3" plain="true"><font color="white">黎明</font></a>
<a class="mini-button" iconCls="icon-help" plain="true"><font color="white">帮助</font></a>
<a class="mini-button" iconCls="top_right_2" plain="true" ><font color="white">收藏夹</font></a>
<a class="mini-button" iconCls="top_right_2" plain="true" ><font color="white">关闭</font></a>
</div>
</div>
<div title="south" region="south" showSplit="false" showHeader="false" height="30" >
<div style="line-height:28px;text-align:center;cursor:default">22</div>
</div>
<div title="asdsa" iconCls="icon-add" showHeader="false" region="west" width="225" maxWidth="250" minWidth="100" showSplitIcon="true" expanded="true">
<!-- 树 -->
<td valign="top" style="width:300px;">
<ul id="tree1" class="mini-tree" url="data/mainTree.txt" style="width:200px;padding:5px;"
showTreeIcon="true" textField="text" idField="id" value="base" expandOnNodeClick="true"
onnodeselect="onNodeSelect">
</ul>
</td>
</div>
<!-- 打开加载 -->
<div title="center" region="center" scrolling="no" >
<div id="mainframe" class="mini-tabs" frameborder="0" name="main" style="width:100%;height:100%;overflow-x: hidden; overflow-y: hidden;" border="0" onactivechanged="onTabsActiveChanged">
<div title="首页" url="tender.jsp" >
</div>
</div>
</div>
</div>
<script type="text/javascript">
mini.parse();
var tree = mini.get("leftTree");
//树的点击事件
function onNodeSelect(e) {
var node = e.node;
var isLeaf = e.isLeaf;
if (isLeaf) {
showTab(node);
}
}
//标签页
function showTab(node) {
var tabs = mini.get("mainframe");
var id = "tab$" + node.id;
var tab = tabs.getTab(id);
if (!tab) {
tab = {};
tab._nodeid = node.id;
tab.name = id;
tab.title = node.text;
tab.showCloseButton = true;
tab.url = node.id + ".jsp";
tabs.addTab(tab);
}
tabs.activeTab(tab);
}
//关闭标签
function removeTab() {
var tab = mini.get("mainframe");
tab.removeAll(tab);
}
function onClick(e) {
var text = this.getText();
alert(text);
}
function onTabsActiveChanged(e) {
var tabs = e.sender;
var tab = tabs.getActiveTab();
if (tab && tab._nodeid) {
var node = tree.getNode(tab._nodeid);
if (node && !tree.isSelectedNode(node)) {
tree.selectNode(node);
}
}
}
//右上角事件
function topRight(n){
if(n==1){
url="shoppingCartWeek.jsp";
$('#mainframe').attr("src",url);
}else if(n==2){
var url=$('#basePath').val();
window.external.addFavorite(url,'234')
}else if(n==3){
mini.open({
url: "/HIP/htwyRes/orderNew/help.jsp",
title: "在线帮助", width: 500, height: 330,
onload: function () {
//var iframe = this.getIFrameEl();
//var data = { action: "edit", id: row.id };
//iframe.contentWindow.SetData(data);
},
ondestroy: function (action) {
//grid.reload();
}
});
}
}
</script>
</body>
</html>
|
|