首先导入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. 上传文件,经过Zuul,中文文件名乱码解决办法

    转载请标明出处: http://blog.csdn.net/forezp/article/details/77170470 本文出自方志朋的博客 问题描述 在项目中又一个上传文件的oss服务,直接调用 ...

  2. rest_framework -- 认证组件

    #####认证组件##### 一.认证是什么就不说了,某些网页必须是用户登陆之后,才能访问的,所以这时候就需要用上认证组件. 你不用rest_framework的认证组件也行,这种认证的话,完全可以自 ...

  3. JetBrains 授权服务器(License Server):

    JetBrains 授权服务器(License Server): https://www.imsxm.com/jetbrains-license-server.html

  4. ABAP术语-LUW (Logical Unit of Work)

    LUW (Logical Unit of Work) 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/04/1089637.html Logi ...

  5. 一次Redis 的性能测试和问题 [问题已经自己解决,见文章最后]

    [我的问题]:请教个问题,我在本机搭建linux虚拟机+redis 3.2.6,然后在本机物理机上面测试虚拟机的redis性能,如下VM配置参数做测试,redis 的性能好像不算太好,问题待排查的两点 ...

  6. Linux分享笔记:系统状态检测命令小结

    作为一名合格的运维人员,要能很好地了解Linux服务器,要能熟练查看Linux系统的运行状态.以下是常用到的Linux系统状态检测命令. 1. ifconfig:用于获取网卡配置与网络状态等信息.通常 ...

  7. C调用约定__cdecl、__stdcall、__fastcall、__pascal分析

    参考原文地址:https://www.cnblogs.com/yenyuloong/p/9626658.html C/C++ 中不同的函数调用规则会生成不同的机器代码,产生不同的微观效果,接下来让我们 ...

  8. Vue报错 [Vue warn]: Cannot find element

    在前端开发全面进入前端的时代 作为一个合格的前端开发工作者 框架是不可或缺的Vue React Anguar 作为前端小白,追随大佬的脚步来到来到博客园,更新现在正在学习的Vue 注 : 相信学习Vu ...

  9. 微信小程序关于tabbar点击切换数据不刷新问题

    微信小程序中经常遇到的需求就是我提交了一个表单或者进行了一个操作,需要在我的个人中心页面中实时显示出来,但是小程序中的tabbar切换类似于tab切换 并不会进行页面刷新请求 所以总是会造成一些数据更 ...

  10. springboot学习(2)

    WebMvcConfigurerAdapter 在springboot2.0及以上版本过时问题 WebMvcConfigurerAdapter已经过时,替代方案: 1 实现 WebMvcConfigu ...