jqgrid点空余地方保存编辑
2012-09-15 20:56
183 查看
jqgrid双击行,进入编辑状态,在不按回车的情况下保存提交内容
var lastsel;
$('html').bind('click', function(e) { //用于点击其他地方保存正在编辑状态下的行
if ( lastsel != "" ) { //if a row is selected for edit
if($(e.target).closest('#EM_Report').length == 0) { //and the click is outside of the grid //save the row being edited and unselect the row
alert(lastsel);jQuery('#EM_Report').jqGrid('saveRow', lastsel);
jQuery('#EM_Report').resetSelection();
lastsel="";
}
}
});
来自http://stackoverflow.com/questions/7311780/jqgrid-sava-row-data-to-db-on-click-out-of-grid方法
var lastsel;
$('html').bind('click', function(e) { //用于点击其他地方保存正在编辑状态下的行
if ( lastsel != "" ) { //if a row is selected for edit
if($(e.target).closest('#EM_Report').length == 0) { //and the click is outside of the grid //save the row being edited and unselect the row
alert(lastsel);jQuery('#EM_Report').jqGrid('saveRow', lastsel);
jQuery('#EM_Report').resetSelection();
lastsel="";
}
}
});
来自http://stackoverflow.com/questions/7311780/jqgrid-sava-row-data-to-db-on-click-out-of-grid方法
相关文章推荐
- 实现jqgrid 行编辑,级联查询,并点击按钮保存
- 解决jqGrid新增或编辑记录保存成功但提示错误的问题
- jqgrid保存按钮,保存以后jqgrid自动刷新 追加或编辑按下后 保存取消以外的按钮非活性
- jqGrid在编辑时(Form类型的)回车保存,esc退出(关闭)编辑
- jqgrid 单击行启用行编辑,切换行保存原编辑行
- jqgrid 编辑行、新增行、删除行、保存行
- jqgrid 选中行触发编辑,切换下一行时验证和异步保存上一行数据
- JqGrid之单元格编辑后保存-yellowcong
- jqgrid 增删查改 添加toolbar 不保存到数据库 artdialog 弹出框编辑
- jqgrid行内编辑,保存
- 自定义jqGrid编辑功能,当行获取焦点时编辑,失去焦点时保存
- FineUI Gird单元格编辑 保存新增的一行到数据库 LINQ
- vim编辑保存时权限不足问题
- 在jqGrid中新增、删除、编辑等操作按钮
- jqGrid的使用方法(编辑,删除,更新,新增)
- 关于在线编辑,点击即可编辑失去焦点即可保存的插件X-editable
- 回到上次编辑的地方
- Jsp利用pageoffice实现在线excel文档的编辑并保存到服务器
- jqgrid 编辑添加功能详细解析
- Win10修改编辑hosts文件后无法保存的解决方法