zoukankan      html  css  js  c++  java
  • EasyUI 布局

    首先导入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=" auto; height: 350px;">
            
            <div data-options="region:'east',split:true" title="East"
                style=" 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=" 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="100%;height:100%;"></iframe>';
                $('#tt').tabs('add', {
                    title : title,
                    content : content,
                    closable : true
                });
            }
        }
    </script>

    最后附上一张效果图

  • 相关阅读:
    SpringBoot连接数据库
    String、StringBuffer、StringBulider的区别和解析
    异常This application has no explicit mapping for /error
    node使用
    JS总结defer与async(一)
    前端项目搭建与知识框架
    git ssh配置总结
    JS算法
    JS数据结构
    Http与Http2与Https区别和联系
  • 原文地址:https://www.cnblogs.com/JohnsonZilch/p/6857389.html
Copyright © 2011-2022 走看看