我想在编辑一行并按Enter键保存更改后再进行一些ajax处理。我该怎么做?
我有这段代码,但只有当我按下内联导航
上的保存按钮时才有效$("#"+tbl).jqGrid('inlineNav',"#"+nav, {
edittext:"Edit",
addtext:"Add",
savetext:"Save",
canceltext:"Cancel",
addParams:{
useDefValues: true,
addRowParams: {
keys: true,
extraparam:{cid:$_GET['cid'], tbl:tbl},
oneditfunc: setFareDefaults
}
},
editParams:{
keys: true,
extraparam:{cid:$_GET['cid'], tbl:tbl},
aftersavefunc : function(id){
$.post('svc/check_pub.php',{cid:$_GET["cid"]}, function(data){
var ret = parseInt(data);
if(ret) {
$("#pubtxt").html("<small style='font-weight:normal;float:right;color:orange'>[this campaign is unpublished]</small>");
} else {
$("#pubtxt").html("<small style='font-weight:normal;float:right;color:green'>[this campaign is published]</small>");
}
},"text");
},
oneditfunc: setFareDefaults
}
});