0

jqgrid の onclickonPgButtons にデータを保存する必要があり、データを保存した後、次/前の行に移動する必要があります。以下の関数は、編集フォームの 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();
    }
}

}

私の問題は、データを保存した後、編集フォームで次/前の行を表示する必要があることです。

前もって感謝します..

4

1 に答える 1

0

あなたの質問が正しいことを理解したらfalse、コールバックから戻ってくださいonclickPgButtons

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

更新:結果の送信時にグリッドをリロードする必要がない場合はreloadAfterSubmit: false、フォーム編集のオプションを使用するだけで済みます (ドキュメントを参照してください)。

于 2013-01-10T12:04:12.270 に答える