首页 新闻 会员 周边

关于sencha2.0,validate的问题

0
悬赏园豆:5 [已关闭问题] 关闭于 2012-06-17 11:59

在model里面有一验证格式:

validations: [             
                { type: 'presence', field: 'title', message: 'title is null' }
            ]

 

之后用

var errors = current.validate()
  if (!errors.isValid()) {
   Ext.Msg.alert('error!',errors.getByField('title')[0].message);
   return;
  }

在errors.getByField('title')[0] 能返回object,

但是errors.getByField('title')[0].message 没得到期望的'title is null’

元’的主页 元’ | 菜鸟二级 | 园豆:204
提问于:2012-06-17 11:36
< >
分享
所有回答(1)
0

fuck,居然是要下划线,这样写:

Ext.Msg.alert('error!',errors.getByField('title')[0]._message);

才能得到 message

元’ | 园豆:204 (菜鸟二级) | 2012-06-17 11:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册