1. #1
    Ext User
    Join Date
    Oct 2007
    Posts
    1
    Vote Rating
    0
    apachejo is on a distinguished road

      0  

    Question NumberField validation does not fire after override of afterRender

    NumberField validation does not fire after override of afterRender


    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;}    
    	}

  2. #2
    Sencha User
    Join Date
    May 2012
    Location
    Ukraine
    Posts
    23
    Vote Rating
    0
    ralfius is on a distinguished road

      0  

    Default


    Try to add this.callParent(arguments) in the end of the overridden method

Thread Participants: 1