一人では解決できない問題があります。だからあなたの助けは非常に高く評価されています. ここに行きます: グリッドで複数の行を編集する場合は常に、さらに処理するためにコントローラーで Bean のリストを取得します...たとえば、変更を保存しますが、1 行だけを編集すると、空のリストが返されます。リストはヌルです。複数の行を編集する場合にのみ機能します。
ここに私のストアとプロキシがあります:
var billRecordStore = null;
function createbillRecordStore() {
var billRecordProxy = new Ext.data.HttpProxy({
api : {
read : applicationPath + '/filterRecords',
update : applicationPath + '/updateRecords'
},
type : 'json',
reader : {
type : 'json',
root : 'data',
idProperty : 'brid',
totalProperty : 'total'
},
writer : {
type : 'json'
},
actionMethods: {
create: 'POST', read: 'POST', update: 'POST', destroy: 'POST'
},
simpleSortMode: true
});
billRecordStore = Ext.create('Ext.data.Store', {
pageSize : 25,
model : 'billRecordModel',
storeId : 'billRecordStore',
proxy : billRecordProxy,
remoteSort : false,
autoLoad : false
});
}
それが私のSpringMVCコントローラーです:
@ResponseBody
@RequestMapping(value = "/updateRecords", method =
{RequestMethod.POST, RequestMethod.GET}, produces =
"application/json")
public ResponseWrapper updateBillrecord(
@RequestBody List<BillRecordsDTO> dirtyBillRecords
) {
if (dirtyBillRecords != null && dirtyBillRecords.size() > 0)
{
billRecordService.updateBillRecords(dirtyBillRecords);
}
return null;
}
このリストList<BillRecordsDTO> dirtyBillRecords
はnull
、グリッドで 1 行だけを編集している場合は常に表示されます。複数の編集された行が完全に機能しています。サーバー側でスローされる例外はありません。フロントエンドでは、Chrome ブラウザーで次の例外のみが発生します。
POST http://localhost:8080/servicetool/updateRecords?_dc=1384181576575 400 (Bad Request) ext-all-debug.js:32379
Ext.define.request ext-all-debug.js:32379
Ext.define.doRequest ext-all-debug.js:71730
Ext.define.update ext-all-debug.js:71455
Ext.define.runOperation ext-all-debug.js:74757
Ext.define.start ext-all-debug.js:74704
Ext.define.batch ext-all-debug.js:42884
Ext.define.sync ext-all-debug.js:43606
Ext.define.save ext-all-debug.js:43634
saveChanges billRecordController.js:113
Ext.create.items.tbar.handler serviceToolView.js:206
Ext.define.fireHandler ext-all-debug.js:46226
Ext.define.onClick ext-all-debug.js:46216
(anonymous function)
wrap
何か案は?もっと情報が必要ですか?ただ私に言って。事前にどうもありがとうございました。エドフレッド