作者:楼外蔷薇花开 | 来源:互联网 | 2023-05-17 15:32
Ivecreatedacustomvtypetoverifymyemails,myTOfieldusesanexclamation.jpgicon,butIwan
I've created a custom vtype to verify my emails, my TO field uses an exclamation.jpg icon, but I want my CC and BCC fields to use a warning icon (since its not req). I've been trying to wrap my head around navigating Ext-JS's API to determine what attributes I had access to (do I have access to attributes that the VType extends from?), and where I needed to specify this.
我创建了一个自定义vtype来验证我的电子邮件,我的TO字段使用了exclamation.jpg图标,但我希望我的CC和BCC字段使用警告图标(因为它不是req)。我一直试图围绕导航Ext-JS的API来确定我可以访问的属性(我是否可以访问VType扩展的属性?),以及我需要指定的位置。
I see through firebug the invalid message uses the css class .x-form-invalid-msg, how could I tell it to look at a different CSS class (looking at firebug I don't know what ID to reference)? Could I utilize the cls: attribute? Or Could I utilize an Ext.get and tweak the cls attribute?
我通过firebug看到无效消息使用css类.x-form-invalid-msg,我怎么能告诉它看一个不同的CSS类(看看firebug我不知道要引用什么ID)?我可以使用cls:属性吗?或者我可以利用Ext.get并调整cls属性吗?
EDIT**
编辑**
I just found the invalidClass Attribute... but I can't seem to get it working. Investigating...
我刚刚找到了invalidClass属性......但我似乎无法让它工作。调查...
EDIT**
编辑**
So it looks like adding the invalidClass attribute to the CC Textbox causes the CC class to reflect the change, but the VType Error isn't changing.
因此,将invalidClass属性添加到CC文本框看起来会导致CC类反映更改,但VType错误不会更改。
Code for my vType Below (does vType have a cls: it can use?):
Ext.apply( Ext.form.VTypes,
{
anEmail: function(emailString)
{
var temp = new Array();
temp = emailString.split(",");
for (var i = 0; i
EDIT** Hey I figured it out after looking @Jollymorphic explanation. My CSS had the extra problem that these textboxes were in form elements. I applied the CSS rule to the ID's of the fields that contained the x-form-invalid class. So it looks similar to this.
#x-form-el-bcc .x-form-invalid-msg{
color: #4279b5;
font: normal 11px tahoma, arial, helvetica, sans-serif;
background-image: url(../images/iwe/shared/warning.gif);
}
#x-form-el-cc .x-form-invalid-msg{
color: #4279b5;
font: normal 11px tahoma, arial, helvetica, sans-serif;
background-image: url(../images/iwe/shared/warning.gif);
}
1 个解决方案