提交验证
通过重载$validate函数实现提交验证。
验证失败返回错误信息,验证成功无需返回。
本例位置:安装目录\YZSoft\request\forms\Leaving.js
本例代码:
$validate: function (args) {
var me = this,
formInfo = args.formInfo,
formData = args.formData,
validationGroup = args.validationGroup,
iDemoLeaving = formData['iDemoLeaving'];
if (Ext.isEmpty(iDemoLeaving[0].Days) &&
Ext.isEmpty(iDemoLeaving[0].DAYS)) //Oracle
return RS.$('Leaving_EnterDays');
}
formData.iDemoLeaving[0].Days访问iDemoLeaving表第一行Days字段。
formInfo中包含了本步骤信息,结合formInfo可实现按步骤验证。
步骤信息:
formInfo.formdataset.Global.Rows[0].StepName
Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents