This article introduces you to the jQuery EasyUI window function through example code. The code is simple and easy to understand, very good, and has reference value. Friends who need it can refer to it
Requirements: Click the [Add] button , pops up a window, and verifies the content of all input items. If the verification passes, it will be submitted to the background action processing. If it fails the verification, a pop-up window will appear.
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>管理取派员</title> <!-- 导入jquery核心类库 --> <script type="text/javascript" src="../../js/jquery-1.8.3.js"></script> <!-- 导入easyui类库 --> <link rel="stylesheet" type="text/css" href="../../js/easyui/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="../../js/easyui/themes/icon.css"> <link rel="stylesheet" type="text/css" href="../../js/easyui/ext/portal.css"> <link rel="stylesheet" type="text/css" href="../../css/default.css"> <script type="text/javascript" src="../../js/easyui/jquery.easyui.min.js"></script> <script type="text/javascript" src="../../js/easyui/ext/jquery.portal.js"></script> <script type="text/javascript" src="../../js/easyui/ext/jquery.cookie.js"></script> <script src="../../js/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script> <script type="text/javascript"> function doAdd(){ $('#addWindow').window("open"); } function doEdit(){ alert("修改..."); } function doDelete(){ alert("删除..."); } function doRestore(){ alert("将取派员还原..."); } //工具栏 var toolbar = [ { id : 'button-add', text : '增加', iconCls : 'icon-add', handler : doAdd }, { id : 'button-edit', text : '修改', iconCls : 'icon-edit', handler : doEdit }, { id : 'button-delete', text : '作废', iconCls : 'icon-cancel', handler : doDelete },{ id : 'button-restore', text : '还原', iconCls : 'icon-save', handler : doRestore }]; // 定义列 var columns = [ [ { field : 'id', checkbox : true, },{ field : 'courierNum', title : '工号', width : 80, align : 'center' },{ field : 'name', title : '姓名', width : 80, align : 'center' }, { field : 'telephone', title : '手机号', width : 120, align : 'center' }, { field : 'checkPwd', title : '查台密码', width : 120, align : 'center' }, { field : 'pda', title : 'PDA号', width : 120, align : 'center' }, { field : 'standard.name', title : '取派标准', width : 120, align : 'center', formatter : function(data,row, index){ if(row.standard != null){ return row.standard.name; } return ""; } }, { field : 'type', title : '取派员类型', width : 120, align : 'center' }, { field : 'company', title : '所属单位', width : 200, align : 'center' }, { field : 'deltag', title : '是否作废', width : 80, align : 'center', formatter : function(data,row, index){ if(data=="0"){ return "正常使用" }else{ return "已作废"; } } }, { field : 'vehicleType', title : '车型', width : 100, align : 'center' }, { field : 'vehicleNum', title : '车牌号', width : 120, align : 'center' } ] ]; $(function(){ // 先将body隐藏,再显示,不会出现页面刷新效果 $("body").css({visibility:"visible"}); // 取派员信息表格 $('#grid').datagrid( { iconCls : 'icon-forward', fit : true, border : false, rownumbers : true, striped : true, pageList: [30,50,100], pagination : true, toolbar : toolbar, url : "../../data/courier.json", idField : 'id', columns : columns, onDblClickRow : doDblClickRow }); // 添加取派员窗口 $('#addWindow').window({ title: '添加取派员', width: 800, modal: true, shadow: true, closed: true, height: 400, resizable:false }); //对收派标准save按钮,添加点击事件 $("#save").click(function(){ //判断是否form中的所有表单对象都通过校验 if($("#standardForm").form('validate')){ //都通过校验 $("#standardForm").submit(); }else{ $.messager.alert("警告","表单存在非法内容,请重新填写","warning"); } //关闭窗口 $("#addWindow").window('sclose'); }); }); function doDblClickRow(){ alert("双击表格数据..."); } </script> </head> <body class="easyui-layout" style="visibility:hidden;"> <p region="center" border="false"> <table id="grid"></table> </p> <p class="easyui-window" title="对收派员进行添加或者修改" id="addWindow" collapsible="false" minimizable="false" maximizable="false" style="top:20px;left:200px"> <p region="north" style="height:31px;overflow:hidden;" split="false" border="false"> <p class="datagrid-toolbar"> <a id="save" icon="icon-save" href="#" class="easyui-linkbutton" plain="true">保存</a> </p> </p> <p region="center" style="overflow:auto;padding:5px;" border="false"> <form id="standardForm" action="../../standard_save.action" method="post"> <table class="table-edit" width="80%" align="center"> <tr class="title"> <td colspan="4">收派员信息</td> </tr> <tr> <td>快递员工号</td> <td> <input type="text" name="courierNum" class="easyui-validatebox" required="true" /> </td> <td>姓名</td> <td> <input type="text" name="name" class="easyui-validatebox" required="true" /> </td> </tr> <tr> <td>手机</td> <td> <input type="text" name="telephone" class="easyui-validatebox" required="true" /> </td> <td>所属单位</td> <td> <input type="text" name="company" class="easyui-validatebox" required="true" /> </td> </tr> <tr> <td>查台密码</td> <td> <input type="text" name="checkPwd" class="easyui-validatebox" required="true" /> </td> <td>PDA号码</td> <td> <input type="text" name="pda" class="easyui-validatebox" required="true" /> </td> </tr> <tr> <td>快递员类型</td> <td> <input type="text" name="type" class="easyui-validatebox" required="true" /> </td> <td>取派标准</td> <td> <input type="text" name="standard.id" class="easyui-combobox" data-options="required:true,valueField:'id',textField:'name', url:'../../standard_findAll.action'"/> </td> </tr> <tr> <td>车型</td> <td> <input type="text" name="vehicleType" class="easyui-validatebox" required="true" /> </td> <td>车牌号</td> <td> <input type="text" name="vehicleNum" class="easyui-validatebox" required="true" /> </td> </tr> </table> </form> </p> </p> <!-- 查询快递员--> <p class="easyui-window" title="查询快递员窗口" closed="true" id="searchWindow" collapsible="false" minimizable="false" maximizable="false" style="width: 400px; top:40px;left:200px"> <p style="overflow:auto;padding:5px;" border="false"> <form id="searchForm"> <table class="table-edit" width="80%" align="center"> <tr class="title"> <td colspan="2">查询条件</td> </tr> <tr> <td>工号</td> <td> <input type="text" name="courierNum" /> </td> </tr> <tr> <td>收派标准</td> <td> <input type="text" name="standard.name" /> </td> </tr> <tr> <td>所属单位</td> <td> <input type="text" name="company" /> </td> </tr> <tr> <td>类型</td> <td> <input type="text" name="type" /> </td> </tr> <tr> <td colspan="2"><a id="searchBtn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a> </td> </tr> </table> </form> </p> </p> </body> </html>
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to use gallery slider component in WeChat mini program
How to use scroll- in WeChat mini program- View component implements scrolling animation
About the use of checkbox component in WeChat applet
How to realize the collision and rebound of multiple small balls through JS
About the use of custom form controls in Angular19
The above is the detailed content of How to use EasyUI window in jQuery. For more information, please follow other related articles on the PHP Chinese website!

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

Different JavaScript engines have different effects when parsing and executing JavaScript code, because the implementation principles and optimization strategies of each engine differ. 1. Lexical analysis: convert source code into lexical unit. 2. Grammar analysis: Generate an abstract syntax tree. 3. Optimization and compilation: Generate machine code through the JIT compiler. 4. Execute: Run the machine code. V8 engine optimizes through instant compilation and hidden class, SpiderMonkey uses a type inference system, resulting in different performance performance on the same code.

JavaScript's applications in the real world include server-side programming, mobile application development and Internet of Things control: 1. Server-side programming is realized through Node.js, suitable for high concurrent request processing. 2. Mobile application development is carried out through ReactNative and supports cross-platform deployment. 3. Used for IoT device control through Johnny-Five library, suitable for hardware interaction.

I built a functional multi-tenant SaaS application (an EdTech app) with your everyday tech tool and you can do the same. First, what’s a multi-tenant SaaS application? Multi-tenant SaaS applications let you serve multiple customers from a sing


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment