|
Model.prototype.bizDataDeviceBeforeSave = function(event) {
// 验证编号不能相同
var data = this.comp("bizDataDevice");
var fCode = data.getValue("fCode");
var params = new biz.Request.ActionParam();
params.setString("termCode", fCode);
var th = this;
biz.Request.sendBizRequest({
"context" : th.getContext(),
"action" : "attes_TermCodeAction",
"dataType" : "json",
"parameters" : params,
"callback" : function(data) {
if (data.response) {
justep.Util.hint("不能注册相同的编号", {
type : 'warning',
parent : th.getRootNode()
});
event.cancel = true; //这执行不了, 还是能保存进去。
}
}
});
}; |
|