最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Can't make allowBlank true visually in ExtJS - Stack Overflow

programmeradmin1浏览0评论

I have textfield:

{
                xtype : 'textfield',
                id: 'specialCode',
                allowBlank: true,
                fieldLabel : 'Special Code',
                name : 'specialCode'
            }

I do make it required when a checkbox is checked with

Ext.getCmp('specialCode').allowBlank = false;
Ext.getCmp('specialCode').validateValue(Ext.getCmp('specialCode').getValue());

I bees red and it bees required.

Then when another checkbox is cheked I use this code

Ext.getCmp('specialCode').allowBlank = true;

It bees not required but the red border does not go away. I need to click the field and some other place in order to remove the red border.

I have textfield:

{
                xtype : 'textfield',
                id: 'specialCode',
                allowBlank: true,
                fieldLabel : 'Special Code',
                name : 'specialCode'
            }

I do make it required when a checkbox is checked with

Ext.getCmp('specialCode').allowBlank = false;
Ext.getCmp('specialCode').validateValue(Ext.getCmp('specialCode').getValue());

I bees red and it bees required.

Then when another checkbox is cheked I use this code

Ext.getCmp('specialCode').allowBlank = true;

It bees not required but the red border does not go away. I need to click the field and some other place in order to remove the red border.

Share Improve this question edited Sep 12, 2011 at 7:25 ilhan asked Sep 12, 2011 at 7:19 ilhanilhan 8,99535 gold badges127 silver badges214 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

use clearInvalid on the field too to reset it's invalidation style.

Ext.getCmp('specialCode').allowBlank = true;
Ext.getCmp('specialCode').clearInvalid();
发布评论

评论列表(0)

  1. 暂无评论