easyui-1
来源:互联网 发布:武汉留学中介知乎 编辑:程序博客网 时间:2024/06/07 08:46
1.引入 head
<script type="text/javascript" src="jquery-easyui-1.4.2/jquery.min.js"></script> <script type="text/javascript" src="jquery-easyui-1.4.2/jquery.easyui.min.js"></script> <link rel="stylesheet" href="jquery-easyui-1.4.2/themes/default/easyui.css" type="text/css"></link> <link rel="stylesheet" href="jquery-easyui-1.4.2/themes/icon.css" type="text/css"></link> <script type="text/javascript" src="jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script></head>
2.dialog demo
<div id="dd" class="easyui-dialog" title="My Dialog" style="width:400px;height:200px;" data-options="iconCls:'icon-save',resizable:true,modal:true"> Dialog Content. </div>
3.panel demo
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><base href="<%=basePath%>"><script type="text/javascript" src="jquery-easyui-1.4.2/jquery.min.js"></script><script type="text/javascript" src="jquery-easyui-1.4.2/jquery.easyui.min.js"></script><link rel="stylesheet" href="jquery-easyui-1.4.2/themes/default/easyui.css" type="text/css"></link><link rel="stylesheet" href="jquery-easyui-1.4.2/themes/icon.css" type="text/css"></link><script type="text/javascript" src="jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script><script type="text/javascript"> $(function(){ $('#bt1').click(function(){ $('#p').panel('open'); }); $('#bt2').click(function(){ $('#p').panel('close'); }); $('#bt3').click(function(){ $('#p').panel('destroy'); }); });</script></head><body> <div id="p" class="easyui-panel" title="My Panel" style="width:500px;height:150px;padding:10px;background:#fafafa;" data-options="iconCls:'icon-save', closable:true,collapsible:false,minimizable:true,maximizable:true,closed:true"> <p>panel content.</p> <p>panel content.</p> </div> <input id="bt1" type="button" value="button1" > <input id="bt2" type="button" value="button2" > <%--销毁--%> <input id="bt3" type="button" value="button3" > </body></html>
4.dialog登录框demo
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><base href="<%=basePath%>"><script type="text/javascript" src="jquery-easyui-1.4.2/jquery.min.js"></script><script type="text/javascript" src="jquery-easyui-1.4.2/jquery.easyui.min.js"></script><link rel="stylesheet" href="jquery-easyui-1.4.2/themes/default/easyui.css" type="text/css"></link><link rel="stylesheet" href="jquery-easyui-1.4.2/themes/icon.css" type="text/css"></link><script type="text/javascript" src="jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script><script type="text/javascript"> var loginAndRegDialog; $(function() { loginAndRegDialog = $('#loginAndRegDialog').dialog({ closable : false, modal : true, resizable : true, buttons : [ { text : '登录', handler : function() { console.info("登录"); $.ajax({ type : "POST", url : "userController/login", data : $('#loginInputForm').serialize(), /*{ name : $('#loginInputForm input[name=name]').val(), pwd : $('#loginInputForm input[name=pwd]').val() }*/ //禁止使用缓存的结果 cache : false, dateType : 'json', success : function(r) { //console.info(r.msg); if (r && r.success){ //登录成功 console.info("成功"); loginAndRegDialog.dialog('close'); $.messager.show({ title:'提示', msg:r.msg, timeout:3, showType:'slide' }); }else{ //失败 console.info("失败"); $.messager.show({ title:'提示', msg:r.msg, timeout:3, showType:'slide' }); } } }); } }, { text : '注册', handler : function() { console.info(); } } ] }); });</script></head><body> <div id="loginAndRegDialog" title="用户登录" style="width:250px;height:200px;"> <form id="loginInputForm" method="post"> <table> <tr> <th align="right">用户名</th> <td><input name="name" type="text"> </td> </tr> <tr> <th align="right">密码</th> <td><input name="pwd" type="password"> </td> </tr> </table> </form> </div></body></html>
package com.ui.control;import javax.servlet.http.HttpServletRequest;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;@Controller@RequestMapping("userController")public class UserController { @RequestMapping("login") @ResponseBody public Json login(HttpServletRequest request){ Json json = new Json(); System.out.println(request.getParameter("name")); System.out.println(request.getParameter("pwd")); json.setSuccess(false); json.setMsg("用户登录失败"); return json; }}
package com.ui.control;public class Json { private boolean success=false; private String msg; private Object object; public boolean isSuccess() { return success; } public void setSuccess(boolean success) { this.success = success; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public Object getObject() { return object; } public void setObject(Object object) { this.object = object; }}
项目下载
end
0 0
- easyui-1
- easyui----1
- 【easyui学习笔记】2.easyui拖放-1
- EasyUI 入门教材1:如何引入EasyUI
- 1 搭建EasyUI环境
- 1、EasyUI数据绑定
- EasyUI 使用示例(1)
- easyui 学习初步1
- jquery-easyui学习(1)
- easyui-1、引入
- easyui学习(1)
- easyUI-datagrid(1)
- easyui-1-基本介绍
- easyUI(1)-------合并单元格
- easyUI入门--1
- easyUI
- EasyUI
- Easyui
- MCC(移动国家码)和 MNC(移动网络码)
- 制作会呼吸的WIFI机器人
- Mac版 反编译apk 获取资源文件和源代码
- ExpandableList
- 杭电ACM 2040:亲和数
- easyui-1
- linux中Oops信息的调试及栈回溯—Linux人都知道,这是好东西!
- java.sql.SQLException: 关闭的 Resultset: next
- IOS开发ObjectC Block的实现方式
- ios学习笔记: IOS之NSArray 中调用的方法详解
- Android studio1.2 shortCuts 小白使用
- Scala 的面向对象编程实践(一)
- Illegal access: this web application instance has been stopped already. Could not load
- android:screenOrientation属性