ExtJS from表单怎么获得值提交到后台去
展开全部
一般使用 form的 submit() 方法
if (formSet.getForm().isValid()){
formSet.getForm().submit({
waitMsg : '正在保存数据 saving....',waitTitle:'请稍候 waiting....',
url:url,
params:params,
method : 'post',
success : function(form, action){
//alert(action.result.success);
if (action.result.success!= undefined){
var rs = action.result.success;
if (action.result.success){
} else{
}
}else{
me.fireEvent("saveFinish",{success:false,msg:'服务器回应 没有SUCCESS'});
}
},
failure: function(form, action) {
var failMsg="";
switch (action.failureType) {
case Ext.form.Action.CLIENT_INVALID:
failMsg='Failure:Form fields may not be submitted with invalid values';
break;
case Ext.form.Action.CONNECT_FAILURE:
failMsg='FailureAjax communication failed';
break;
case Ext.form.Action.SERVER_INVALID:
//failMsg=action.result.msg;
failMsg='服务器回应 没有SUCCESS MSG:'+action.result.msg;
}
},
});
}else{
alert('请输入正确的数据');
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询