EasyUI Datagrid 取编辑修改后的内容
- <script type="text/javascript">
- $(function () {
- $('#tt').datagrid({
- iconCls: 'icon-edit',
- method: 'post',
- pagination: true,
- rownumbers: true,
- pageSize: 10,
- pageList: [5, 10, 15, 20],
- singleSelect: true,
- idField: 'HHID',
- url: '/admin/admin/JsonBianming',
- columns: [[
- { field: 'HHID', title: '编号', width: 100 },
- { field: 'HHTitle', title: '标题', width: 100 },
- { field: 'HHUrl', title: 'Url', width: 300,editor:{
- type:'validatebox',
- options:{
- validType: 'url'
- }
- } },
- {
- field: 'action', title: '操作', width: 70, align: 'center',
- formatter: function (value, row, index) {
- if (row.editing) {
- var s = '<a href="javascript:void(0)" onclick="saverow(' + index + ')">保存</a> ';
- var c = '<a href="javascript:void(0)" onclick="cancelrow(' + index + ')">取消</a>';
- return s + c;
- } else {
- var e = '<a href="javascript:void(0)" onclick="editrow(' + index + ')">编辑</a> ';
- var d = '<a href="javascript:void(0)" onclick="deleterow(' + index + ')">删除</a>';
- return e + d;
- }
- }
- },
- ]],
- onBeforeEdit: function (index, row) {
- row.editing = true;
- $('#tt').datagrid('refreshRow', index);
- },
- onAfterEdit: function (index, row) {
- row.editing = false;
- $('#tt').datagrid('refreshRow', index);
- },
- onCancelEdit: function (index, row) {
- row.editing = false;
- $('#tt').datagrid('refreshRow', index);
- }
- });
- })
- //修改
- function editrow(index) {
- $('#tt').datagrid('beginEdit', index);
- }
- //删除
- function deleterow(index) {
- $.messager.confirm('Confirm', '确定要删除这条吗?', function (r) {
- if (r) {
- $('#tt').datagrid('deleteRow', index);
- }
- });
- }
- //保存
- function saverow(index_) {
- $('#tt').datagrid('endEdit', index_);
- //取修改过的行集合
- var rows = $('#tt').datagrid('getChanges');
- //alert(rows[0].HHUrl); //rows[0].HHUrl 取修改后内容
}- //取消修改
- function cancelrow(index) {
- $('#tt').datagrid('cancelEdit', index);
- }
- </script>
- <table id="tt"></table>
EasyUI Datagrid 取编辑修改后的内容的更多相关文章
- easyui datagrid 批量编辑和提交数据
easyui datagrid 行编辑和提交方,废话就不多说了,直接上代码 <div style="margin: 5px;"> <table id=" ...
- easyui datagrid 每条数据后添加操作按钮
easyui datagrid 每条数据后添加“编辑.查看.删除”按钮 1.给datagrid添加操作字段:字段值 <table class="easyui-datagrid" ...
- ListView与.FindControl()方法的简单练习 #2 -- ItemUpdting事件中抓取「修改后」的值
原文出處 http://www.dotblogs.com.tw/mis2000lab/archive/2013/06/24/listview_itemupdating_findcontrol_201 ...
- EasyUI Datagrid 鼠标悬停显示单元格内容 复制代码
EasyUI Datagrid 鼠标悬停显示单元格内容 ,halign:, align: 0 « 上一篇:LINQ to Entities 中的查询» 下一篇:去掉字符串中的非数字字符 posted ...
- easyui datagrid可编辑表格使用经验分享
文章目录 1相关接口方法 2列属性formatter 3编辑器类型 3.1基于my97的编辑器 3.2简单的密码编辑器 3.3动态增加/删除编辑器 4字段的级联操作 4.1combobox的级联操作 ...
- easyUi datagrid鼠标经过提示单元格内容
此文章是基于 EasyUI+Knockout实现经典表单的查看.编辑 一. jquery.cellTip.js /** * 扩展两个方法 */ using('datagrid', function() ...
- 关于EasyUI DataGrid行编辑时嵌入时间控件
本人做一个名为“安徽中控”项目时,为快速开发基础数据增删改模块,遂采用EasyUIDatagrid将所有增删改查的操作都集中于表格中,并且所有增删改查操作都集中于泛型对象,从而不必为每个表写具体的增删 ...
- git创建/合并分支/删除分支/将修改后的内容同步到GitHub远程仓库
1.创建分支并切换到刚创建的分支(这里创建新的分支来修改README.md的内容然后将创建的分支与master分支合并,最后删除创建的分支) $ git checkout -b 分支名 Switche ...
- EasyUI DataGrid能编辑
创建DataGrid <table id="tt"></table> $('#tt').datagrid({ title:'Editable Dat ...
随机推荐
- android之回调函数的意义
本文出自xiaanming的博客(http://blog.csdn.net/xiaanming/article/details/17483273) 看完这篇文后大家可以看看这个http://blog. ...
- SQL获取刚插入的记录的自动增长列ID的值
假设表结构如下: CREATE TABLE TestTable ( id int identity, CreatedDate datetime ) SQL2005获得新增行的自动增长列的语句如下: i ...
- Android获取屏幕宽度的4种方法
方法一: WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE); int width = w ...
- C# 中控件 WebBrowser 对 frameset/ iframe 操作和内容获取
1.获取frame的document HtmlDocument htmlDoc = webBrowser1.Document; htmlDoc = webBrowser1.Document.Wind ...
- Eclipse 调试maven test
在eclipse中调试maven test 一般情况下,使用如下方式都不能使myeclipse检测到程序中的断点: 项目 -> Run As -> maven test 或 项目 -> ...
- mongoDB知识总结
官方说明文档:https://docs.mongodb.com/manual/mongo/ 1 NoSQL 简介 NoSQL,全称是”Not Only Sql”,指的是非关系型的数据库(相对于关系型数 ...
- axure注册码
ahjesus Axure RP 7.0注册码 用户名:axureuser 序列号:8wFfIX7a8hHq6yAy6T8zCz5R0NBKeVxo9IKu+kgKh79FL6IyPD6lK7G6+t ...
- <%@include和<jsp:include
博客地址:http://www.cnblogs.com/shizhongtao/p/3506742.html欢迎交流 <%@ include %>是编译时包含,<jsp:includ ...
- how to Enable Client Integration
i got a problem,the problem is list cant use export to excel button in sharepoint 2010. I found my a ...
- [DOM]有一种节点叫做文本节点
HTML可以看成是由节点(node)组成的树结构 我们一般都是在<p>节点里面写字符串. 在上图中,<p>节点和字符串之间有一个text, 这个text就是文本节点. 我们可以 ...