updateBondType : function (button){
var me = this;
// var grid = button.up('grid');
// var records = store.getModifiedRecords();
var grid=Ext.ComponentQuery.query('XXXX',null,true);
var win=button.up('window');
var form=win.down('form').getForm();
var bond = form.findField("***").getValue();
var arr = new Array();
var records = grid.getSelectionModel().getSelection();
Ext.each(records,function(record){//遍历行数据数组
arr.push(record.data);
});
var ii = Ext.encode(arr);
Ext.MessageBox.confirm('保存', '确定保存修改的订单?', function(result) {
if (result == 'yes') {
Ext.MessageBox.wait('数据处理中...', '请稍后...');
Ext.Ajax.post({
url:'*****/****',
params: {
arrs: ii,
bondedType:bond
},
method:'POST',
timeout: 30 * 60 * 1000,
waitMsg: '正在处理,请稍等...',
}).then(result =>{
Ext.Msg.alert("提示", result.message);
win.close();
......
}).catch(error => {
Ext.Msg.alert("警告", error.message);
});
}
});
},
后台Con:
需要@RequestBody注解
后台DTO对象:
private String arrs;
private String bondedType;
JSON转list:
@SuppressWarnings("unchecked")
List<XXX> ts = (List<XXXX>) JSONArray.parseArray(param.getArrs(), XXXX.class);