如何从重新加载停止JqGrid

时间:2013-01-10 10:59:13

标签: jquery jqgrid

我需要在jqgrid中的onclickonPgButtons上保存数据并在保存数据之后需要转到下一个/上一行.Below函数是在编辑表单的OnClickPgButton函数上编写的。

   jQuery("#table").jqGrid('navGrid', '#pager', { search: false, refresh: false, del: false, add: false, cloneToTop: true }, { height: editFormheight, width: editFormwidth, reloadAfterSubmit: true, closeAfterEdit: true, recreateForm: true, cloneToTop: true,
    onclickPgButtons: function (whichbutton, formid, rowid) { ModificationDataSave(whichbutton, formid, rowid); $("#edithdtable").stop(); }
});
function ModificationDataSave(whichbutton, formid, rowid) {

if ($("#" + $("#PId").val()).closest("td").text().trim() != $("#Name").val()) {
    if (confirm('There is some unsaved data. Would you like to save?')) {
        $("#sData").trigger("click");
    }
    else {
        $("#edithdtable").stop();
    }
}

}

我的问题是保存数据后,我需要在editform中显示下一行/上一行。

先谢谢..

1 个答案:

答案 0 :(得分:0)

如果我理解您的问题,那么您应该从回调false返回onclickPgButtons

onclickPgButtons: function (whichbutton, formid, rowid) {
    if (...) { // do some tests
        return false;
    }
}

更新:如果您无需重新加载网格提交结果,则只需使用表单编辑的reloadAfterSubmit: false选项(请参阅{{3 }})。

相关问题