Results 1 to 4 of 4

Thread: ExtJS 2.0 RC1 - Numberfield Trigger Problem

  1. #1
    wki
    Guest

    Question ExtJS 2.0 RC1 - Numberfield Trigger Problem

    How can use TriggerField with NumberField?
    I try to extend but... ...button clear doesn't appear!!


    Code:
    Ext.namespace('Ext.ux');
    
    Ext.ux.NumberFieldTrigger = Ext.extend(Ext.form.NumberField, {
        initComponent : function () { 
            Ext.form.TriggerField.superclass.initComponent.call(this);
            
        },
    
        getTrigger : Ext.form.TriggerField.prototype.getTrigger,    
        initTrigger : Ext.form.TriggerField.prototype.initTrigger,
    
        triggerClass : 'x-form-clear-trigger',    
        hideTrigger : false,
    
        onTriggerClick : function(){
    		alert('onTrigger1Click');
        }
    });

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854

    Default

    You can't extend one class and then call the superclass of another class. If anything, you should just be extending TriggerField to do something. What are you trying to accomplish?

  3. #3
    wki
    Guest

    Default

    I see this POST and try it with NumberField
    http://extjs.com/forum/showthread.php?t=15842

    I want a NumberField with clear button!

  4. #4
    wki
    Guest

    Smile [SOLVED] ExtJS 2.0 RC1 - Numberfield Trigger Problem

    Code:
    Ext.namespace('Ext.ux');
    
    Ext.ux.NumberFieldTrigger = function(config) {
    	Ext.ux.NumberFieldTrigger.superclass.constructor.call(this, config);
    }
    
    Ext.ux.NumberFieldTrigger = Ext.extend(Ext.form.TriggerField, {
    
    	allowDecimals : Ext.form.NumberField.prototype.allowDecimals,
    	allowNegative : Ext.form.NumberField.prototype.allowNegative,
    
    	baseChars : Ext.form.NumberField.prototype.baseChars,
    	decimalPrecision : Ext.form.NumberField.prototype.decimalPrecision,
    	decimalSeparator : Ext.form.NumberField.prototype.decimalSeparator,
    	fieldClass : Ext.form.NumberField.prototype.fieldClass,
    	maxText : Ext.form.NumberField.prototype.maxText,
    	maxValue : Ext.form.NumberField.prototype.maxValue,
    	minText : Ext.form.NumberField.prototype.minText,
    	minValue : Ext.form.NumberField.prototype.minValue,
    	nanText : Ext.form.NumberField.prototype.nanText,
    
    	beforeBlur : Ext.form.NumberField.prototype.beforeBlur,
    	fixPrecision : Ext.form.NumberField.prototype.fixPrecision,
    	getValue : Ext.form.NumberField.prototype.getValue,
    	initEvents : Ext.form.NumberField.prototype.initEvents,
    	parseValue : Ext.form.NumberField.prototype.parseValue,
    	setValue : Ext.form.NumberField.prototype.setValue,
    	validateValue : Ext.form.NumberField.prototype.validateValue,
    
    	triggerClass : 'x-form-clear-trigger',
    	hideTrigger : false,
    
    	onTriggerClick : function() {
    
    		alert('onTriggerClick');
    
    	}
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •