easyui 可编辑的数据网格简单的尝试
jquery.edatagrid.js下载:http://www.jeasyui.net/extension/190.html在这里的实例里
直接贴代码,看看上面那个网站其实挺容易的
<%-- Created by IntelliJ IDEA. User: hasee Date: 2017/2/11 Time: 12:58 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="/ssm/static/jquery-easyui-1.5.1/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="/ssm/static/jquery-easyui-1.5.1/themes/icon.css"> <link rel="stylesheet" type="text/css" href="/ssm/static/jquery-easyui-1.5.1/demo/demo.css"> <script type="text/javascript" src="/ssm/static/jquery-easyui-1.5.1/jquery.min.js"></script> <script type="text/javascript" src="/ssm/static/jquery-easyui-1.5.1/jquery.easyui.min.js"></script> <script type="text/javascript" src="/ssm/static/jquery-easyui-1.5.1/jquery.edatagrid.js"></script> </head> <body> <table id="dg" title="My Users" style="width:700px;height:250px" toolbar="#toolbar" idField="id_" rownumbers="true" fitColumns="true" singleSelect="true"> <thead> <tr> <th field="id_" width="50" editor="{type:'validatebox',options:{required:true}}">id_</th> <th field="name_" width="50" editor="{type:'validatebox',options:{required:true}}">姓名</th> <th field="age_" width="50" editor="text">年龄_</th> </tr> </thead> </table> <div id="toolbar"> <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:$('#dg').edatagrid('addRow')">New</a> <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:$('#dg').edatagrid('destroyRow')">Destroy</a> <a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:$('#dg').edatagrid('saveRow')">Save</a> <a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="javascript:$('#dg').edatagrid('cancelRow')">Cancel</a> </div> <script type="text/javascript"> $(function () { $('#dg').edatagrid({ url: 'e_query.do', saveUrl: 'e_insert.do', updateUrl: 'e_update.do', destroyUrl: 'e_delete.do' //移除一行时会传id过去,而不是id_ }); }); </script> </body> </html>
相关推荐
nmgxzm00 2020-11-10
ifconfig 2020-10-14
hhanbj 2020-11-17
zfszhangyuan 2020-11-16
古叶峰 2020-11-16
一个智障 2020-11-15
jipengx 2020-11-12
81427005 2020-11-11
xixixi 2020-11-11
游走的豚鼠君 2020-11-10
苗疆三刀的随手记 2020-11-10
Web卓不凡 2020-11-03
小飞侠V 2020-11-02
帕尼尼 2020-10-30
爱读书的旅行者 2020-10-26
帕尼尼 2020-10-23
杏仁技术站 2020-10-23
淼寒儿 2020-10-22