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