欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Extjs優(yōu)化(二)Form表單提交通用實(shí)現(xiàn)

 更新時(shí)間:2013年04月15日 11:59:07   作者:  
本文就將演示下一個(gè)實(shí)例使用該代碼只需要13行代碼 原始需要25-30行代碼搞定,感興趣的朋友可以參考下哈,希望可以幫助到你
復(fù)制代碼 代碼如下:

/**
* 提交表單
*/
function $postForm(a) {
if (a.formPanel.getForm().isValid()) {
var b = a.scope ? a.scope: this;
a.formPanel.getForm().submit({
scope: b,
url: a.url,
method: "post",
params: a.params,
waitMsg: "正在提交數(shù)據(jù)...",
success: function(c, d) {
Ext.ux.Toast.msg("操作信息", "成功信息保存!");
if (a.callback) {
a.callback.call(b, c, d);
}
},
failure: function(c, d) {
Ext.MessageBox.show({
title: "操作信息",
msg: "信息保存出錯(cuò),請(qǐng)聯(lián)系管理員!",
buttons: Ext.MessageBox.OK,
icon: "ext-mb-error"
});
if (a.callback) {
a.callback.call(b);
}
}
});
}
}

使用改代碼只需要13行代碼 原始需要25-30行代碼搞定 ,示例:
復(fù)制代碼 代碼如下:

saveRecord: function() {
$postForm({
formPanel:this.formPanel,
scope:this,
url: __ctxPath + "/basedata/saveStudentDepartment.action",
params:{},
callback: function(d, f) {
var e = Ext.getCmp("StudentDepartmentGrid");
if (e != null) {
e.getStore().reload();
}
b.close();
}
});

相關(guān)文章

最新評(píng)論