<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="keywords" content="jquery,ui,easy,easyui,web" /> <meta name="description" content="easyui help you build your web page easily!" /> <title>短信管理</title> <link href="../Scripts/easyui/themes/default/easyui.css" rel="stylesheet" /> <link href="../Scripts/easyui/themes/icon.css" rel="stylesheet" /> <link href="../Scripts/easyui/demo/demo.css" rel="stylesheet" /> <style type="text/css"> #fm { margin: 0; padding: 10px 30px; } .ftitle { font-size: 14px; font-weight: bold; color: #666; padding: 5px 0; margin-bottom: 10px; border-bottom: 1px solid #ccc; } .fitem { margin-bottom: 5px; } .fitem label { display: inline-block; width: 80px; } </style> <script type="text/javascript" src="../Scripts/easyui/jquery.min.js"></script> <script type="text/javascript" src="../Scripts/easyui/jquery.easyui.min.js"></script> <script type="text/javascript" src="../Scripts/easyui/locale/easyui-lang-zh_CN.js"></script> <script type="text/javascript"> var url; function newUser() { $('#dlg').dialog('open').dialog('setTitle', '添加短信'); $('#fm').form('clear'); url = "/OnlineMonitoring/ashx/MSGMgr.ashx?type=insert"; } function editUser() { var row = $('#dg').datagrid('getSelected'); if (row) { $('#dlg').dialog('open').dialog('setTitle', '编辑短信内容'); $('#fm').form('load', row); url = "/OnlineMonitoring/ashx/MSGMgr.ashx?type=update"; } else { parent.$.messager.alert('提示', '请选择一行', "info"); } } function saveUser() { $('#fm').form('submit', { url: url, onSubmit: function () { return $(this).form('validate'); }, success: function (result) { var result = eval('(' + result + ')'); if (result.result) { $('#dlg').dialog('close'); // close the dialog $('#dg').datagrid('reload'); // reload the user data } else { $.messager.show({ title: '服务端错误', msg: "添加失败" }); } } }); } function removeUser() { var row = $('#dg').datagrid('getSelected'); if (row) { parent.$.messager.confirm('操作提示', '你确定删除这条短信吗?', function (r) { if (r) { $.post("/OnlineMonitoring/ashx/MSGMgr.ashx?type=delete", { short_message_id: row.short_message_id }, function (result) { if (result.result) { $('#dg').datagrid('reload'); // reload the user data } else { $.messager.show({ // show error message title: '服务端错误', msg: "删除短信失败" }); } }, 'json'); } }); } } </script></head><body class="easyui-layout"> <div data-options="region:'center',fit:true,border:false" style="height: 100%"> <table id="dg" title="短信管理" class="easyui-datagrid" url="/OnlineMonitoring/ashx/MSGMgr.ashx?type=select" toolbar="#toolbar" pagination="false" rownumbers="true" fitcolumns="true" singleselect="true" fit="true" method="get"> <thead> <tr> <th field="short_message_content" width="50" align="center">短信内容</th> <th field="short_message_time" width="50" align="center">短信创建时间</th> <th field="short_message_state" width="50" align="center" formatter="messageFormater">短信状态</th> </tr> </thead> </table> </div> <div id="toolbar"> <a href="#" class="easyui-linkbutton" iconcls="icon-add" plain="true" οnclick="newUser()">添加</a> <a href="#" class="easyui-linkbutton" iconcls="icon-edit" plain="true" οnclick="editUser()">编辑</a> <a href="#" class="easyui-linkbutton" iconcls="icon-remove" plain="true" οnclick="removeUser()">删除</a> </div> <div id="dlg" class="easyui-dialog" style="width: 400px; height: 280px; padding: 10px 20px" closed="true" buttons="#dlg-buttons"> <div class="ftitle">短信信息</div> <form id="fm" method="post" novalidate> <input type="hidden" name="short_message_id" /> <div class="fitem"> <label>短信内容:</label> <input name="short_message_content" class="easyui-validatebox" required="true"> </div> </form> </div> <div id="dlg-buttons"> <a href="#" class="easyui-linkbutton" iconcls="icon-ok" οnclick="saveUser()">确认</a> <a href="#" class="easyui-linkbutton" iconcls="icon-cancel" οnclick="javascript:$('#dlg').dialog('close')">取消</a> </div></body></html><style type="text/css"> .panel-title { text-align: center; font-size: 20px; } #sex { width: 50px; }</style><script> function messageFormater(val) { if (val == 1) { return "已发送"; } else { return "未发送"; } }</script>
EasyUI简单CRUD
发布日期:2021-08-25 04:21:17
浏览次数:2
分类:技术文章
本文共 4163 字,大约阅读时间需要 13 分钟。
转载地址:https://blog.csdn.net/weixin_33843947/article/details/85821636 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
不错!
[***.144.177.141]2024年04月06日 18时30分02秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
C++_类和对象_对象特性_构造函数的分类以及调用---C++语言工作笔记041
2019-04-26
C++_类和对象_对象特性_拷贝构造函数调用时机---C++语言工作笔记042
2019-04-26
C++_类和对象_对象特性_构造函数调用规则---C++语言工作笔记043
2021-06-29
C++_类和对象_对象特性_深拷贝与浅拷贝---C++语言工作笔记044
2019-04-26
AndroidStudio_android中实现对properties文件的读写操作_不把properties文件放在assets文件夹中_支持读写---Android原生开发工作笔记238
2019-04-26
弹框没反应使用Looper解决_the caller should invoke Looper.prepare() and Looper.loop()---Android原生开发工作笔记239
2019-04-26
Command line is too long. Shorten command line for Application---微服务升级_SpringCloud Alibaba工作笔记0067
2019-04-26
C++_类和对象_对象特性_初始化列表---C++语言工作笔记045
2019-04-26
C++_类和对象_对象特性_静态成员函数---C++语言工作笔记047
2019-04-26
kivy制作安卓APP--简单音乐播放器
2019-04-26
十年(程序员改编)
2019-04-26
c++排序算法个人总结
2019-04-26
看完你就知道的乐观锁和悲观锁
2019-04-26
Docker入门
2019-04-26