首先导入js

<link rel="stylesheet" href="../js/easyui/themes/default/easyui.css">
<link rel="stylesheet" href="../js/easyui/themes/icon.css"> <script type="text/javascript" src="../js/jquery-2.2.3.min.js"></script> <script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>

创建页面布局

<p>This sample shows how to create a complex layout.</p>
<div style="margin: 20px 0;"></div>
<div class="easyui-layout" id="LayoutTest"
style="width: auto; height: 350px;"> <div data-options="region:'east',split:true" title="East"
style="width: 180px;">
<ul class="easyui-tree"
data-options="url:'tree_data1.json',method:'get',animate:true,dnd:true"></ul>
</div>
<div data-options="region:'west',split:true" title="West"
style="width: 100px;">
<div class="easyui-accordion" data-options="fit:true,border:false">
<div title="TreeMenu" style="padding: 10px;">
<ul class="easyui-tree">
<li><span>Foods</span>
<ul>
<li><span>Fruits</span>
<ul>
<li>apple</li>
<li>orange</li>
</ul></li>
<li><span>Vegetables</span>
<ul>
<li>tomato</li>
<li>carrot</li>
<li>cabbage</li>
<li>potato</li>
<li>lettuce</li>
</ul></li>
</ul></li>
</ul>
</div>
<div title="Title2" data-options="selected:true"
style="padding: 10px;">
<div style="margin-bottom: 10px; text-align: center;">
<a href="javascript:void(0);"
onclick="addTab('google','http://www.baidu.com')">baidu</a><br>
<a href="javascript:void(0);"
onclick="addTab('jquery','http://jquery.com/')">jquery</a>
<a href="javascript:void(0);"
onclick="addTab('easyui','http://jeasyui.com/')">easyui</a>
<a href="javascript:void(0);"
onclick="addTab('myjsp','/test/myjsp.do')">myjsp</a>
</div>
</div>
<div title="Title3" style="padding: 10px">content3</div>
</div>
</div>
<div
data-options="region:'center',title:'Main Title',iconCls:'icon-ok'">
<div class="easyui-tabs" data-options="fit:true,border:false,plain:true" id="tt">
<div title="About" data-options="href:'_content.html'"
style="padding: 10px"></div>
<div title="DataGrid" style="padding: 5px">
<table class="easyui-datagrid"
data-options="url:'datagrid_data1.json',method:'get',singleSelect:true,fit:true,fitColumns:true">
<thead>
<tr>
<th data-options="field:'itemid'" width="80">Item ID</th>
<th data-options="field:'productid'" width="100">Product ID</th>
<th data-options="field:'listprice',align:'right'" width="80">List
Price</th>
<th data-options="field:'unitcost',align:'right'" width="80">Unit
Cost</th>
<th data-options="field:'attr1'" width="150">Attribute</th>
<th data-options="field:'status',align:'center'" width="50">Status</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>

编写js代码,动态生成标签Tabs

<script>
function addTab(title, url) {
if ($('#tt').tabs('exists', title)) {
$('#tt').tabs('select', title);
} else {
var content = '<iframe scrolling="auto" frameborder="0" src="'
+ url + '" style="width:100%;height:100%;"></iframe>';
$('#tt').tabs('add', {
title : title,
content : content,
closable : true
});
}
}
</script>

最后附上一张效果图

EasyUI 布局 - 动态添加标签页(Tabs)的更多相关文章

  1. EasyUI创建异步树形菜单和动态添加标签页tab

    创建异步树形菜单 创建树形菜单的ul标签 <ul class="easyui-tree" id="treeMenu"> </ul> 写j ...

  2. ES6面向对象 动态添加标签页

    HTML <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml&quo ...

  3. EasyUI中动态生成标签页

    这是最近学到的内容,当时是有思路但是不知道怎么获取当前的点击对象,就没有实现功能,通过更深入的学习,我知道了不仅仅是Java,Oracle中有一个this,同样的EasyUI中也存在一个this,来获 ...

  4. easyui 动态添加标签页,总结

    步骤 1:创建 Tabs <div style="margin-bottom:10px"> <a href="#" class="e ...

  5. js 面向对象 动态添加标签

    有点逻辑 上代码 thml布局 点击查看代码 <!DOCTYPE html> <html lang="en"> <head> <meta ...

  6. C# 后台动态添加标签(span,div) 以及模板添加

    很多时候.我们需要在后台用C#代码添加html标签.而不是在html源码中添加. 比如在html源码中简单的一个input 标签 <input type="type" nam ...

  7. javascript的document中的动态添加标签

    document的高级篇中提供了节点操作的函数,具体包括:获取节点,改变节点,删除节点,替换节点,创建节点,添加节点,克隆节点等函数.我们可以利用这些函数动态改变html的节点. 1.JavaScri ...

  8. FineUI 点击按钮添加标签页

    <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat=&quo ...

  9. Easyui 关闭jquery-easui tab标签页前触发事件

    关闭jquery-easui tab标签页前触发事件 by:授客 QQ:1033553122 测试环境 jquery-easyui-1.5.3 需求场景 点击父页面tab 页关闭按钮时,需要做判断,判 ...

随机推荐

  1. 配置JAVA_HOME踩得坑 。。

    配置JAVA_HOME 的时候这里不能有空格哦 ,还以为什么呢...

  2. oracle-sql脚本导出EXCEL数据

    在数据库中,经常有业务人员提出需求导出数据库中的业务数据,而且是每天.每周或每月定时导出.为了方便,可将sql查询的脚本 通过下面脚本来导出EXCEL数据. 1.将查询sql脚本(AAA.sql)放到 ...

  3. Sass 基础(八)

    @import Sass 支持所有css 的@规则,以及一些Sass 专属的规则,也被称为“指令(directive)”.这些规则在Sass 中具有不同的 功效,详细解释如下. @import Sas ...

  4. 动态规划(二)HDU1114

    1.题目来源HDU1114 Sample Input 3 10 110 2 1 1 30 50 10 110 2 1 1 50 30 1 6 2 10 3 20 4 Sample Output The ...

  5. Python学习:for 循环 与 range()函数

    for 循环   For … in 语句是另一种循环语句,其特点是会在一系列对象上进行迭代(Iterates),即它会遍历序列中的每一个项目 注意:  1.else 部分是可选的.当循环中包含它时,它 ...

  6. html 弹框 优化 alert

    <!DOCTYPE html> <html> <head> <title>cs</title> </head> <styl ...

  7. QOS-QOS(服务质量)概述

    QOS-QOS(服务质量)概述 2018年7月7日  20:29 概述及背景: 1.  引入: 传统IP网络仅提供“尽力而为”的传输服务,网络有可用资源就转发,资源不足时就丢弃 新一代IP网络承载了 ...

  8. linux文件操作篇 (二) 打开和关闭文件

    2.1 打开文件和关闭文件 #include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>  头文件 i ...

  9. Python自动化运维——系统进程管理模块

    Infi-chu: http://www.cnblogs.com/Infi-chu/ 模块:psutil psutil是一个跨平台库,可以很轻松的为我们实现获取系统运行的进程和资源利用率等信息. 功能 ...

  10. rhel6.4 根目录扩容

    状况:根目录容量不足 解决:扩容根目录 ====================================================== 解决步骤: 1. 将新的磁盘加入服务器 2. 使用 ...