在datagrid中如何实现让一行进入编辑状态,修改数据后,保存信息呢?

     //点击列表变成文本框,进入可编辑状态

     $(function () {
var doc = $(document),
table = $("#divReportTable");
doc.on("mousedown", ".btnEdit", function () { var th = $(this),
ind = th.attr("index"),
keyid = th.attr("keyid"); type = th.attr("type");
if (th.hasClass("btnEdit")) {
if (type == "edit") { table.datagrid("beginEdit", ind);
setTimeout(function () {
th.html("保存")
.attr("type", "sava");
var _ele = table.datagrid('getEditors', ind); })
} else if (type == "sava") {
var ele = table.datagrid('getEditors', ind); table.datagrid("endEdit", ind);//结束编辑 @*//执行保存的操作
$.ajax({
url: '@Url.Action("ActionName", "ControllerName")',
data: { "ID": keyid, "Score": Score },
type: "POST",
async: true,
dataType: "json",
success: function (result) {
if (result.Success == true) {
RefreshData()
} else {
//alert('失败');
}
}
});*@
}
}
}) doc.on("mousedown", ".datagrid-editable-input", function () {
//alert('点击了文本框');
console.log(this);
//PersonSelect('11', '11txt'); var user = $(this).val();
$(this).val(user.UserName); }); })
col.push({
title: "操作", field: "Operate", width: 120, align: "center", resizeable: false, formatter: function (value, row, index) {
return "<a href=\"javascript:void(0)\" class='btnEdit' index='" + index + "' keyid='" + row.ID + "' type='edit'>编辑</a>"
}
});
colOne.push({
title: "填报人", field: "FillUser", width: 135, align: "center", resizeable: false, rowspan: rows, formatter: function (value, row) {
return WorkModel.FormateUser(row.FillUser, row.FillUserName, 1, row.ID, fromType);
},
editor: { type: "text" }
});

给列加上editor:{type:"text"} 进入编辑状态后,编辑状态下,这一列将显示成文本框. type:字符串,编辑类型,可选值:text,textarea,checkbox,numberbox,validatebox,datebox,combobox,combotree。

Easyui 设置datagrid 进入编辑状态,保存结束编辑的更多相关文章

  1. 学习日记6、easyui datagrid 新增一行,编辑行,结束编辑和删除行操作记录

    1.新增一行并进入编辑状态 var index=$('#Numbers').datagrid('appendRow', { CardInformation: '开户行', CardNumber: '银 ...

  2. easyui的datagrid用js插入数据等编辑功能的实现

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  3. easyui,datagrid表格,行内可编辑

    最近用到easyui,需要表格内编辑,但是我同一个页面有多个表格,把官方的代码修改了一下,如下: HTML代码 <table id="dg" class="easy ...

  4. odoo14 编辑状态和非编辑状态下隐藏

    1 <div class="oe_edit_only"> 2 <a name="remove_group_id" type="obj ...

  5. easyUI的datagrid控件日期列不能正确显示Json格式数据的解决方案

    EasyUI是一套比较轻巧易用的Jquery控件,在使用过程中遇到一个问题,它的列表控件——datagrid, 在显示日期列的时候,由于后台返回给页面的数据是Json格式的,其中的日期字段,在后台是正 ...

  6. easyUI的datagrid控件日期列格式化

    转自:https://blog.csdn.net/idoiknow/article/details/8136093 EasyUI是一套比较轻巧易用的Jquery控件,在使用过程中遇到一个问题,它的列表 ...

  7. EasyUI的datagrid获取所有正在编辑状态的行的行编号

    今天项目需要用了下EasyUI的datagrid的行编辑功能,跟着API来,只要是将各种状态时的处理逻辑弄好,还是蛮不错的. 开发过程中,遇到了个问题,在编辑完成后我需要获取datagrid所有处于编 ...

  8. easyui分页,编辑datagrid某条数据保存以后跳转到某一页

    参考资料:http://caizhilin2010.iteye.com/blog/1731698 问题:商品列表页面采用easyui的datagrid展示数据,编辑某行数据保存以后,要求跳转到 用户在 ...

  9. 使用EasyUI的Datagrid的Editor进行行编辑,Enter回车结束编辑,并开启新的一行。

    //新增数据function add() { if (Index == undefined) { row = { move_date: '', start_time: '', end_time: '' ...

随机推荐

  1. index+match函数在压实度中对盒号盒质量随机不重复的最佳使用

    首先按照升序排列好盒号和盒质量,使其一一对应, 盒号    盒重量    随机值rand()     随机值大小排列rank 1         2001       0.01             ...

  2. 又见SpringMVC

    一.如何让一个普通类成为Controller? 方案一:实现接口Controller解析:handleRequest(request,response) 方案二:继承AbstractControlle ...

  3. idea 插件的使用 进阶篇

    CSDN 2016博客之星评选结果公布    [系列直播]零基础学习微信小程序!      "我的2016"主题征文活动   博客的神秘功能 idea 插件的使用 进阶篇(个人收集 ...

  4. Subsets II

    Given a collection of integers that might contain duplicates, nums, return all possible subsets. Not ...

  5. linux系统top命令查看系统状态

    Linux系统可以通过top命令查看系统的CPU.内存.运行时间.交换分区.执行的线程等信息.通过top命令可以有效的发现系统的缺陷出在哪里.是内存不够.CPU处理能力不够.IO读写过高. 使用SSH ...

  6. 【WPF】释放图像资源, [删除时报另一进程占用]

    源:zhantianyou CODE private BitmapImage ReturnBitmap(string destFile) { // Read byte[] from png file ...

  7. 【转】Windows平台下的Subversion安装配置新手指南

    原文地址:http://developer.51cto.com/art/201005/199628.htm 本文介绍Subversion安装配置快速指南,首先讲Subversion的安装和配置,Uni ...

  8. Linux用户管理(centos)

    useradd testuser; 添加用户 testuser为用户名 passwd testuser; 修改用户密码 提示两次输入密码   赋予root权限 修改 /etc/sudoers 文件,找 ...

  9. Oracle11g字符集AL32UTF8修改为ZHS16GBK详解

    此问题发生在数据库迁移过程中.源数据库:自己笔记本上win7 64位系统的oracle11g个人版,字符集ZHS16GBK :目标数据库,HP的sqlserver2008 系统 64位数据库服务器,字 ...

  10. PM成长之路(一)

    到底什么样的人适合任项目经理一直是很多企业的困惑,因为大家发现优秀项目经理的特质看起来和传统的职能经理或技术专家很不一样.当企业在决定开展一个重大的项目时,如果不能找到一个适合带领和管理项目的项目经理 ...