0

在我编辑一行并按 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
        }

    });
4

0 回答 0