form表单中,必须输入框要求显示红色星号的处理方式:
如果项目中整体均按照此要求进行设计,可以重写EXTJS的label显示:
代码如下:
Ext.override(Ext.form.field.Base,{
//针对form中的基本组件
initComponent:function(){
if(this.allowBlank!==undefined && !this.allowBlank){
if(this.fieldLabel){
this.fieldLabel = '<font color="red">*</font>' + this.fieldLabel; }
} this.callParent(arguments);
}
});