ExtJS4:如何在文本框,组合框等旁边显示验证错误消息 [英] ExtJS4: How to show validation error message next to textbox, combobox etc

查看:173
本文介绍了ExtJS4:如何在文本框,组合框等旁边显示验证错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要实现出现在无效字段旁边的验证消息。任何帮助将不胜感激。

I need to implement validation messages that appear right next to invalid field. Any help would be appreciated.

推荐答案

msgTarget:'side' will在字段右侧添加一个错误图标,仅在悬停的弹出窗口中显示消息。

msgTarget: 'side' will Add an error icon to the right of the field, displaying the message in a popup on hover only.

如果仔细阅读文档,还有一个选项是msgTarget http:// docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Text-cfg-msgTarget

if you read the documentation carefully, one more option is there for msgTarget http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Text-cfg-msgTarget

[element id]将错误消息直接添加到指定元素的innerHTML。
您必须使用id动态添加td到控件的右侧。那么如果你指定 msgTarget:'元素id'它将工作。

这篇关于ExtJS4:如何在文本框,组合框等旁边显示验证错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆