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>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值