跪求解决办法extjs

yueyemoyan 2011-09-28 04:32:03
items: [{
id : 'mytest',
xtype : 'field.areaCode',
allowBlank : false,
// vtype:'uniqueareaCode',
listeners : {
blur : function(text){
Ext.Ajax.request({
method : 'POST',
url : 'api/machine/area/addValue',
params : {
areaCode: text.getValue()
},
success : function(response){
var value = response.responseText;
var object =Ext.JSON.decode(value);
var success = object.success;
//text.setActiveError('dfd');
if(success == false){

//text.setActiveError('error!');
var aa = Ext.getCmp('mytest');
aa.markInvalid('erroraaa');

}else{

console.debug('qqqq');
}
}
// ,
// failure : function(){
// Ext.Msg.alert('提示','加载失败!');
// }
});
},
scope : this
}
}





onAddConfirm: function() {
var form = this.getAddWin().down('form');
data = this.getAddWin().down('form').getForm().getValues();
var bool = this.getAddWin().down('form').getForm().isValid();
var aa = Ext.getCmp('mytest');
var bool2 = aa.validate();
// if(bool==true && !aa._myDirty){
// this.addRecord(data);
// this.getAddWin().close();
// }
console.debug(bool);
console.debug(bool2);
if(bool == true){
this.addRecord(data);
this.getAddWin().close();
}
else {
Ext.Msg.alert('提示','输入有误!');
}

},


当输入框中提示错误时,var bool2 = aa.validate(); bool2 的值还是true???不应该验证不通过,是false
...全文
83 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
liju123456 2011-10-14
  • 打赏
  • 举报
回复
看不懂。

87,990

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧