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后面就都会有红星号了,方便日后统一修改,[b]注意:[/b]方法重写的代码最好放到onReady函数上面
[img]http://dl.iteye.com/upload/attachment/252396/39edd1de-0fc7-3d8c-8284-b101b1d76212.png[/img]