jqgrid行编辑
来源:互联网 发布:全球网络推广 编辑:程序博客网 时间:2024/05/21 16:55
ondblClickRow: function(id){if(id && id !== lastsel){var rowData = $("#jqGridId").jqGrid("getRowData", id); $('#jqGridId').jqGrid('restoreRow',lastsel);$('#jqGridId').jqGrid('editRow',id,{keys : true,//这里按[enter]保存url: s2web.appURL + "jq/save.action",mtype : "POST",restoreAfterError: true,extraparam: {"ware.id": rowData.id,"ware.warename": $("#"+id+"_name").val(),"ware.createDate": $("#"+id+"_date").val(),"ware.number": $("#"+id+"_amount").val(),"ware.valid": $("#"+id+"_type").val()},oneditfunc: function(rowid){console.log(rowid);},succesfunc: function(response){alert("save success");return true;},errorfunc: function(rowid, res){console.log(rowid);console.log(res);}});}}
jQuery("#grid_id").jqGrid('editRow',rowid, keys, oneditfunc, succesfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc);
jQuery("#grid_id").jqGrid('editRow',rowid, {"keys" : false,"oneditfunc" : null,"successfunc" : null,"url" : null, "extraparam" : {},"aftersavefunc" : null,"errorfunc": null,"afterrestorefunc" : null,"restoreAfterError" : true,"mtype" : "POST"});
这里对以上各个参数的意思做一个简单的描述
- rowid:当前编辑的rowid
- succesfunc:如果定义了改函数,将会在请求成功调用后立即返回,该函数签名包括server返回的数据。同时该函数需要返回tue/false
- url: 如果定义了改值,将会覆盖jqGrid中的editurl(当然,如果没有url和editurl是会报错的)。如果url="clientArray" 那么就不会向server端触发请求,可在后期手动调用修改
- extraparam:请求参数列表{name:value, name:value},将会append到requestData中向server端发送
- aftersavefunc:如果定义了改函数,将会在数据向server端保存后立即调用,该函数接受rowid、response参数。同样如果是上面的url="clientArray"该函数同样执行
- errorfunc:如果定义了改函数,将会在数据向server端保存后调用,该函数接受rowid、response参数
- afterrestorefunc:如果定义了改函数,将在restoreRow后调用,接受rowid作为参数
在http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing 中对于innerEdit主要有以下几个方法:
写道
editRow //在用户出发edit事件时调用该方法
saveRow //用户不需要调用该方法,在edit时会自动调用
restoreRow //回滚当前editRow
addRow //新增row
inlineNav
saveRow //用户不需要调用该方法,在edit时会自动调用
restoreRow //回滚当前editRow
addRow //新增row
inlineNav
$("#addBtn").bind("click", function() {$("#jqGridId").jqGrid('addRow',{rowID : "new_row", initdata : {}, position :"first", useDefValues : true, useFormatter : true, addRowParams : {extraparam:{ }}});//当前新增id进入可编辑状态$('#jqGridId').jqGrid('editRow','new_row',{keys : true,//这里按[enter]保存url: s2web.appURL + "jq/save.action",mtype : "POST",restoreAfterError: true,extraparam: {},oneditfunc: function(rowid){console.log(rowid);},succesfunc: function(response){alert("save success");return true;},errorfunc: function(rowid, res){console.log(rowid);console.log(res);}});});
- jqgrid行编辑
- jqGrid行编辑DEMO
- jqGrid行编辑配置
- jqGrid行编辑事件
- jqGrid行编辑配置
- jqgrid编辑行 event事件
- jqgrid 行内编辑操作
- jqgrid实现行编辑功能
- jqgrid行内编辑,保存
- jqGrid编辑
- jqgrid编辑
- jqgrid编辑
- jqGrid行编辑配置,方法,事件
- jqGrid行编辑配置,方法,事件
- jqGrid行编辑配置,方法,事件
- jqgrid 实现行编辑,表单编辑的列联动
- jqgrid 编辑添加功能
- jqgrid编辑以及自定义
- 其实while(1) 和for(;;)是有区别的(在vc++6.0进行测试)
- java mail 发送多个附件
- 打开Win7的图片预览功能...
- 使用正则表达式找出不包含特定字符串的条目
- Andriod杂项
- jqgrid行编辑
- oracle等待事件8——段上的等待事件
- 内存分配方式,堆区,栈区,new/delete/malloc/free
- 如何处理海量数据
- 【数据结构】折半查找(二分查找)
- VS2012 中MFC的控件找不到了?
- 严重 Error starting endpointjava.lang.Exception Socket bind failed
- Hadoop集群作业调度算法
- android加速度传感器