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方法