function submitForm() {
if (dataForm.isAdd) {
dataForm.form.submit({
clientValidation : true,
waitMsg : '正在提交数据,请稍候......',
waitTitle : '提示',
url : 'evaAdd.action',
delay : 300,
method : 'POST',
success : function(form, action,response) {
win.hide();
var re = eval(action.result.data);
alert("result == " +re[0].id);
Ext.Msg.alert('提示', '新增成功');
var store = afnExt.evaluation.stores.EvStore;
store.clear;
store.load();
},
failure : function(form, action) {
Ext.Msg.alert('提示', '新增失败');
}
});
} else {
dataForm.form.submit({
clientValidation : true,
waitMsg : '正在提交数据请稍后',
waitTitle : '提示',
url : 'evaEdit.action',
method : 'POST',
success : function(form, action) {
win.hide();
updateGrid(action.result.dataId);
Ext.Msg.alert('提示', '修改成功');
},
failure : function(form, action) {
Ext.Msg.alert('提示', '修改失败');
}
});
}
}