必填项的label后面加星号

Ext.form.TextField.override({  

                initComponent: Ext.form.TextField.prototype.initComponent.createInterceptor(function(){  

                    if (this.allowBlank === false && this.fieldLabel) {  

                        this.fieldLabel += '<font color=red>*</font>';  

                    }  

                })  

            });  

所有的输入项如果配置了allowBlack 为false,它的label后面就都会有红星号了,方便日后统一修改。

这段代码加在appbase.js的最后,label里不需要再写 <font color=\'red\'>*</font>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2021-09-20
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案