java:easyui(重点示例)

1.accordion(可折叠的):

  

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI鐨勯潰鏉跨粍浠?</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
 </head>
 <body>
      <div id="aa" class="easyui-accordion" style="width:300px;height:200px;">
        <div title="Title1" data-options="iconCls:‘icon-save‘" style="overflow:auto;padding:10px;">
            <h3 style="color:#0099FF;">Accordion for jQuery</h3>
            <p>Accordion is a part of easyui framework for jQuery.
            It lets you define your accordion component on web page more easily.</p>
        </div>
        <div title="Title2" data-options="iconCls:‘icon-reload‘" style="padding:10px;">
            content2
        </div>
        <div title="Title3" data-options="selected:true">
            content3
        </div>
    </div>
 </body>
</html>

2.datagrid(数据表格):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI的window组件</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">

    </script>
 </head>
 <body>
    <table class="easyui-datagrid" title="Basic DataGrid" style="width:700px;height:250px"
            data-options="singleSelect:true,collapsible:true,url:‘datagrid_data1.json‘,method:‘get‘,pagination:true,
                pageSize:10">
        <thead>
            <tr>
                <th data-options="field:‘itemid‘,width:80">Item ID</th>
                <th data-options="field:‘productid‘,width:100">Product</th>
                <th data-options="field:‘listprice‘,width:80,align:‘right‘">List Price</th>
                <th data-options="field:‘unitcost‘,width:80,align:‘right‘">Unit Cost</th>
                <th data-options="field:‘attr1‘,width:250">Attribute</th>
                <th data-options="field:‘status‘,width:60,align:‘center‘">Status</th>
            </tr>
        </thead>
    </table>

 </body>
</html>

3.dialog(会话):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI的window组件</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">

    </script>
 </head>
 <body>
     <div id="dd" class="easyui-dialog" title="My Dialog" style="width:400px;height:200px;"
            data-options="iconCls:‘icon-save‘,resizable:true,modal:true,collapsible:true,maximizable:true,buttons:[{
                text:‘保存‘,
                handler:function(){
                    alert(‘save...‘);
                }
            },{
                text:‘关闭‘,
                handler:function(){
                    $(‘#dd‘).dialog(‘close‘);
                }
            }]">
        Dialog Content.
    </div>
 </body>
</html>

4.form(表格):

  

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI的面板组件</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
 </head>
 <body>
        <form id="ff" method="post">
        <div>
            <label for="name">Name:</label>
            <input class="easyui-validatebox" type="text" name="name" data-options="required:true" />
        </div>
        <div>
            <label for="email">Email:</label>
            <input class="easyui-validatebox" type="text" name="email" data-options="validType:‘email‘" />
        </div>
         <div>
            <label for="email">Password:</label>
            <input class="easyui-passwordbox" type="text" name="password" />
        </div>
        <div>
            <label for="email">Birthday:</label>
            <input id="dd" type="text" class="easyui-datebox" required="required">
        </div>
        <div>
            <label for="email">Birthday2:</label>
            <input id="dd" type="text" class="easyui-datetimebox" required="required">
        </div>
       <div>
            <label for="email">Age:</label>
            <input id="dd" type="text" class="easyui-numberbox" required="required" data-options="min:1,max:150">
        </div>

    </form>
 </body>
</html>

5.layout(布局):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI鐨刲ayout</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
 </head>
 <body>
     <div id="cc" class="easyui-layout" style="width:100%;height:700px">
        <div data-options="region:‘north‘,title:‘North Title‘,split:true" style="height:100px;"></div>
        <div data-options="region:‘south‘,title:‘South Title‘,split:true" style="height:100px;"></div>
        <div data-options="region:‘east‘,title:‘East‘,split:true" style="width:100px;"></div>
        <div data-options="region:‘west‘,title:‘West‘,split:true" style="width:100px;"></div>
        <div data-options="region:‘center‘,title:‘center title‘" style="padding:5px;background:#eee;"></div>
    </div>
 </body>
</html>

6.layout2(布局2):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI鐨刲ayout</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript">
         function addTabs(id){
            if ($(‘#tt‘).tabs(‘exists‘, id)){
                $(‘#tt‘).tabs(‘select‘, id);
            } else {
                $("#tt").tabs(‘add‘,{
                    title:id,
                        content:‘Tab Body‘,
                        closable:true
                });
            }
         }
    </script>
 </head>
 <body>
     <div id="cc" class="easyui-layout" style="width:100%;height:700px">
        <div data-options="region:‘north‘,title:‘North Title‘,split:true" style="height:100px;">
            <h1>WELCOME!</h1>
        </div>
        <div data-options="region:‘west‘,title:‘MENU‘,split:true" style="width:200px;">
                <div id="aa" class="easyui-accordion" style="width:192px;height:200px;">
                    <div title="USER MANAGER" data-options="iconCls:‘icon-save‘" style="overflow:auto;padding:10px;">
                        <ul>
                            <li><span id="addUser" onclick="addTabs(‘addUser‘)">ADD USER</span></li>
                            <li><span id="listUser" onclick="addTabs(‘listUser‘)">LIST USER</span></li>
                        </ul>
                    </div>
                    <div title="ROLE MANAGER" data-options="iconCls:‘icon-reload‘" style="padding:10px;">
                        content2
                    </div>
                    <div title="RIGHT MANAGER">
                        content3
                    </div>
                </div>
        </div>
        <div data-options="region:‘center‘" id="tt" class="easyui-tabs" style="padding:5px;background:#eee;">
                    <div title="index" style="padding:20px;display:none;">
                        tab1
                    </div>
        </div>
         <div data-options="region:‘south‘,title:‘South Title‘,split:true" style="height:100px;">
                     <h2>Copyright</h2>
        </div>
    </div>
 </body>
</html>

7.message(消息):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI的window组件</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        $(function(){
                //$.messager.alert(‘Warning‘,‘The warning message‘);
                /*
                $.messager.alert({
                    title:‘警告‘,
                    msg:‘警告信息!‘,
                    icon:‘warning‘
                });
                */
                /*
                $.messager.confirm({
                    title: ‘My Title‘,
                    msg: ‘Are you confirm this?‘,
                    fn: function(r){
                        if (r){
                            alert(‘confirmed: ‘+r);
                        }
                    }
                });
                */
                $.messager.prompt({
                    title: ‘Prompt‘,
                    msg: ‘Please enter your name:‘,
                    fn: function(r){
                        if (r){
                            alert(‘Your name is:‘ + r);
                        }
                    }
                });
        })
    </script>
 </head>
 <body>

 </body>
</html>

8.panel(控制面板):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI鐨勯潰鏉跨粍浠?</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        //椤甸潰杞藉叆鍑芥暟(椤甸潰鍔犺浇瀹屾垚瑙﹀彂)
        $(function(){
            $(‘#p‘).panel({
                width:600,
                height:200,
                title:‘My Panel‘,
                tools:[
                    {
                        iconCls:‘icon-add‘,
                        handler:function(){
                            alert(‘new‘);
                        }
                    },
                    {
                        iconCls:‘icon-save‘,
                        handler:function(){
                            alert(‘save‘);
                        }
                    }
                ]
            });
        })
    </script>
 </head>
 <body>
    <div id="p" style="padding:10px;">
        <p>panel content.</p>
        <p>panel content.</p>
    </div>

 </body>
</html>

9.panel2(控制面板2):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI鐨勯潰鏉跨粍浠?</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
 </head>
 <body>
    <div style="margin:20px 0 10px 0;">
        <a href="#" class="easyui-linkbutton" onclick="javascript:$(‘#p‘).panel(‘open‘)">OPEN</a>
        <a href="#" class="easyui-linkbutton" onclick="javascript:$(‘#p‘).panel(‘close‘)">CLOSE</a>
    </div>
    <!--闈㈡澘-->
    <div id="p" class="easyui-panel" title="Basic Panel Title" style="width:700px;height:200px;padding:10px;left:200px;top:100px"
            data-options="iconCls:‘icon-save‘,
                collapsible:true,minimizable:true,maximizable:true">
        <p style="font-size:14px">jQuery EasyUI framework helps you build your web pages easily.</p>
        <ul>
            <li>easyui is a collection of user-interface plugin based on jQuery.</li>
            <li>easyui provides essential functionality for building modem, interactive, javascript applications.</li>
            <li>using easyui you don‘t need to write many javascript code, you usually defines user-interface by writing some HTML markup.</li>
            <li>complete framework for HTML5 web page.</li>
            <li>easyui save your time and scales while developing your products.</li>
            <li>easyui is very easy but powerful.</li>
        </ul>
    </div>
 </body>
</html>

10.tabs(标签页):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI鐨勯€夐」鍗$粍浠?</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#newBtn").click(function(){
                    $("#tt").tabs(‘add‘,{
                        title:‘New Tab‘,
                        content:‘Tab Body‘,
                        closable:true,
                        tools:[{
                            iconCls:‘icon-mini-refresh‘,
                            handler:function(){
                                alert(‘refresh‘);
                            }
                        }]
                    });
            });
        });
    </script>
 </head>
 <body>
     <a href="#" id="newBtn" class="easyui-linkbutton">NEW TABS</a>
      <div id="tt" class="easyui-tabs" style="width:500px;height:250px;">
        <div title="Tab1" style="padding:20px;display:none;">
            tab1 Content
        </div>
        <div title="Tab2" data-options="closable:true" style="overflow:auto;padding:20px;display:none;">
            tab2
        </div>
        <div title="Tab3" data-options="iconCls:‘icon-reload‘,closable:true" style="display:none;">
            tab3
        </div>
    </div>
 </body>
</html>

11.window(窗口):

<!doctype html>
<html lang="zh">
 <head>
  <title>easyUI的window组件</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css">
    <script type="text/javascript" src="easyui/jquery.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">

    </script>
 </head>
 <body>
    <div>
        <a href="#" class="easyui-linkbutton" onclick="javascript:$(‘#win‘).window(‘open‘); ">打开</a>
        <a href="#" class="easyui-linkbutton" onclick="javascript:$(‘#win‘).window(‘close‘); ">关闭</a>
    </div>
    <div id="win" class="easyui-window" title="My Window" style="width:600px;height:400px;"
            data-options="iconCls:‘icon-save‘,closed:true">
        Window Content
    </div>
 </body>
</html>
时间: 2024-10-28 20:33:37

java:easyui(重点示例)的相关文章

Java基础重点指南

Java基础重点指南 每个人都有自己的学习方法,下面是我学完Java后总结的一些要点: 一:(了解)Java诞生于1995年,由Sun公司开发.它把源代码编译成“中间码”,然后通过“Java虚拟机”把中间码“翻译”成机器码,再在本机上运行.Java有3个版本(Java SE,Java EE,Java ME),SE用于桌面程序开发,也是Java基础,EE用于企业式开发(如网站等),ME用于嵌入式开发(如掌上电脑,移动通讯开发等).通过 Java 可以做很多,但前提是要深入学习. 二:Java 编译

java io重点整理部分

java io流      1)java io流相关概念 输出流: 输入流: 因此输入和输出都是从程序的角度来说的. 字节流:一次读入或读出是8位二进制. 字符流:一次读入或读出是16位二进制. 字节流和字符流的原理是相同的,只不过处理的单位不同而已.后缀是Stream是字节流,而后缀是Reader,Writer是字符流.  节点流:直接与数据源相连,读入或读出. 直接使用节点流,读写不方便,为了更快的读写文件,才有了处理流. 处理流:与节点流一块使用,在节点流的基础上,再套接一层,套接在节点流

Java广度优先爬虫示例(抓取复旦新闻信息)

一.使用的技术 这个爬虫是近半个月前学习爬虫技术的一个小例子,比较简单,怕时间久了会忘,这里简单总结一下.主要用到的外部Jar包有HttpClient4.3.4,HtmlParser2.1,使用的开发工具(IDE)为intelij 13.1,Jar包管理工具为Maven,不习惯用intelij的同学,也可以使用eclipse新建一个项目. 二.爬虫基本知识 1.什么是网络爬虫?(爬虫的基本原理) 网络爬虫,拆开来讲,网络即指互联网,互联网就像一个蜘蛛网一样,爬虫就像是蜘蛛一样可以到处爬来爬去,把

spring框架整合使用定时任务框架java quartz的示例代码配置

原创整理不易,转载请注明出处:spring框架整合使用定时任务框架java quartz的示例代码配置 代码下载地址:http://www.zuidaima.com/share/1775583461723136.htm 有时候我们的任务(Job)需要再某些任务完成之后才能进行:例如从旧的数据库批量导数据的时候:需要现将被其他数据依赖的数据导入新的数据库:然后再进行关系的导入..在这种情况下我们就可以使用Quartz的listener来做文章了. 首先我们写一个主任务的类,命名为MainJob:她

java Log4j完整示例

原文:java Log4j完整示例 源代码下载地址:http://www.zuidaima.com/share/1550463640816640.htm 应用实例将日志信息同时输出到控制台,文件和数据库中 .

Java线程join示例详解

Java线程的join方法可用于暂停当前线程的执行直至目标线程死亡.Thread中一共有三个join的重载方法. public final void join():该方法将当前线程放入等待队列中,直至被它调用的线程死亡为止.如果该线程被中断,则会抛出InterruptedException异常. public final synchronized void join(long millis):该方法用于让当前线程进入等待状态,直至被它调用的线程死亡或是经过millis毫秒.由于线程的执行依赖于操

Kafka JAVA客户端代码示例--高级应用

什么时间使用高级应用? 针对一个消息读取多次 在一个process中,仅仅处理一个topic中的一组partitions 使用事务,确保每个消息只被处理一次 使用高级应用(调用较底层函数)的缺点? SimpleConsumer需要做很多额外的工作(在以groups方式进行消息处理时不需要) 在应用程序中跟踪上次消息处理的offset 确定一个topic partition的lead broker 手工处理broker leander的改变 使用底层函数(SimpleConsumer)开发的步骤

Java开发Hbase示例

Java开发Hbase示例 使用Hbase操作数据 package com.sunteng.clickidc.test; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; impo

从一个简单的Java单例示例谈谈并发

一个简单的单例示例 单例模式可能是大家经常接触和使用的一个设计模式,你可能会这么写 public class UnsafeLazyInitiallization { private static UnsafeLazyInitiallization instance; private UnsafeLazyInitiallization() { } public static UnsafeLazyInitiallization getInstance(){ if(instance==null){ /