にアクションボタンを押す保存に返送された場合にどのように追加し、インラインを保つためにjgGridは、ツールバーにボタンを追加し、アクション列でアクションボタンを保存インライン含まれています。 リモートjsonデータが使用されます。 保存アクションボタンを押してインライン追加を終了し、サーバーがエラーを返すと、 行が追加され、グリッドから削除され、入力された行データが失われます。 formatoptions にrestoreAfterError:falseを追加し、以下のコードに示すようにインライン追加ボタンを追加しましたが、保存アクションボタンを押すとこれらの設定は無視されます。保存アクションボタンが押された場合、その編集は、エラーの後に続けることができるようにモードを追加し、インラインで行を維持するための方法エラーがjqgrid
?
colModel: [ {
name:"_actions",
formatter:"actions",
formatoptions:{
editbutton:true,
keys:true,
// this is ignored if action column save button is pressed:
restoreAfterError:false,
delbutton:true
}
} , ...
],
editurl: '/Grid/Edit',
datatype: "json",
インラインは、ボタンを追加使用して追加された:
$grid.jqGrid('inlineNav', '#grid_toppager', {
addParams: {
position: "beforeSelected",
rowID: '_empty',
useDefValues: true,
addRowParams: {
keys: true,
// this is ignored if action column save button is pressed:
restoreAfterError: false,
}
},
editParams: {
keys: true,
// this is ignored if action column save button is pressed:
restoreAfterError: false,
},
add: true,
edit: false,
save: true,
cancel: true
});
ありがとうございます。回答のコードを使用してrestoreAfterErrorを設定しても問題は解決されません。 jqGridソースコードの2箇所でrestoreAfterErrorを変更しました。これで問題は解決します。 '$ .extend($ .jgrid.inlineEdit、{ restoreAfterError:false }}を作成する方法。 '問題の原因を確認する私はinlineEdit – Andrus
@Andrusのためのgitからパッチを適用したコードを使用しています:私は、元の**使用[デモプロジェクト](http://www.ok-soft-gmbh.com/jqGrid/jqGridExportToExcel_editerror.zip)に私の提案をテストjqGrid 4.3.1 **。 jqGrid 4.3.1にはいくつかの既知のバグがありますが、上記の機能は正しく動作します。私はデモで 'ModifyGridData'のメインコードをコメントしたので、編集は常にエラーを返します。 '(コメント参照;' addParams.addRowParams'と 'editParams'の' inlineNav'特性の一部またはI 'の$ .extend($ jgrid.inlineEdit、{偽restoreAfterErrorを})を使用する場合にfalse'の:私は 'restoreAfterErrorを使用する場合Index.aspxの一部) - どちらも動作します。 – Oleg
@Andrus:jqGridの*あなたの変更されたコード*に問題があるはずです。 – Oleg