The code below was used to override the afterRender of Ext.form.Field to allow quicktips for the fields and their labels by supplying a field config option for quicktips (ex. qtipCfg:{title:"Title", text:"Text"}). The code was copied from another thread and modified slightly. It seemed to work fine. Then, I noticed that the field validators are not firing after overriding. Also, a NumberField will allow alpha characters after overriding.
This is used in an Ext 1.1.1 solution.
Any ideas?
Thanks.
Code:
Ext.override(Ext.form.Field, {
afterRender : function() {
Ext.form.Field.superclass.afterRender.call(this);
if (this.qtipCfg){
Ext.QuickTips.register({target:this.getEl(), title:this.qtipCfg.title, text:this.qtipCfg.text, enabled: true});
var label = findLabel(this);
if (label) {Ext.QuickTips.register({target:label, title:this.qtipCfg.title, text:this.qtipCfg.text, enabled:true});}
}
}
});
});
var findLabel = function(field) {
var wrapDiv = null; label = null
wrapDiv = field.getEl().up('div.x-form-element');
if (wrapDiv) {label = wrapDiv.child('label');}
if (label) {return label;}
wrapDiv = field.getEl().up('div.x-form-item');
if (wrapDiv) {label = wrapDiv.child('label');}
if (label) {return label;}
}