87,993
社区成员
发帖
与我相关
我的任务
分享


updataUser: function(button){
console.log('进入修改保存按钮');
var win = button.up('window'),
form = win.down('form'),
record = form.getRecord(),
values = form.getValues();
record.set(values);
//// this.getUsersStore().sync();
Ext.Ajax.request({
method : 'post',
type : 'jsonp',
url : 'http://127.0.0.1:8080/extJS/user/update',
async : false,
timeout : 60000,
scope : this,
param : {
id : record.data.id,
nama : record.data.name,
userName : record.data.userName,
age : record.data.age
},
//请求成功时回调函数
success : function() {
Ext.ux.Toast.msg("信息提示", "成功修改所选记录!");
},
//请求失败时回调函数
failure : function() {
Ext.ux.Toast.msg("信息提示", "信息修改出错,请联系管理员!");
}
});
win.close();
}


@RequestMapping("/update")
@ResponseBody
public int updateUser(User user) throws IOException{
int result = userService.updateOne(user);
return result;
}