表单提交的数据:
function submit() {var frm= Ext.getCmp("cform").getForm()
if(!frm.getForm().isValid()) return;
frm.getForm().submit({
waitMsg:'正在提交数据',
waitTitle:'提示',
url:'AccessJson.aspx',
method:'Getform',
success:function(form, action) {
Ext.Msg.alert('提示','保存成功');
},
failure:function(form, action) {
Ext.Msg.alert('提示','原因如下:'+ action.result.errors.info);
}
});
}
imgform.form.submit({
url: 'ResourceI/dFile.aspx?Param=' + methodName + '&urlField=htfile',
waitMsg: '正在上传......',
waitTitle: '请稍等',
method: 'POST',
success: function(f, action) {
if (action.result.success == 'success') {
}
else {
}
},
failure: function(form, action) {
imgform.form.reset();
if (action.failureType == Ext.form.Action.SERVER_INVALID)
Ext.MessageBox.alert('警告',
'上传失败,请稍后重试!');
}
});
表单加载数据:
({
url: 'AccessJson.aspx',
params: {Param: "Getform", objectId: ""},
failure: function(form, action) { Ext.Msg.alert("出错", action.result.errorMessage);}
});
Ext.getCmp("Info_Form").getForm().load({
url: "ApplyJson.aspx",
params: { param: 'QueryBasicInformationByCustomerID', objectID: SubSelectionID },
success: function(form, action) {
},
failure: function(form, action) {
CommitButton.disable();
Ext.Msg.alert("加载出错", action.result.errorMessage);
}
});
表单重置:
function
reset() {
frm.getForm().reset();
}
("POST","../Work/WorkJson.aspx?Param=add",
{
success: function(respose, option)
{
var result = Ext.util.JSON.decode(respose.responseText);
if (result.operateType = "success")
{
parent.reloadMessage("SP");
alert("保存成功!");
};
},
failure: function()
{
alert("save failure");
}
},
'jsonArrayModified=' + encodeURIComponent(Ext.encode(jsonArrayModified))
);
url:"ReceiveJson.aspx?Param=Delete",
success:function(resp,opts){
var respText = Ext.util.JSON.decode(resp.responseText); Store.remove(selections);
alert("操作成功"),
},
failure:function(resp,opts)
{
Ext.MessageBox.alert('警告', '删除文件失败,请稍后重试!');
},
params:{objectId:selections[0].get("Id")}
});
}
})