您的位置:首页 > 其它

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方法
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: