static/ext/src/ux/form/field/ClearButton.js
function() {
            if (!this.clearOnEscape) {
                return;
            }

            // Using a KeyMap did not work: ESC is swallowed by combo box and date field before it reaches our own KeyMap
            this.textField.inputEl.on('keydown',
                function(e) {
                    if (e.getKey() == Ext.EventObject.ESC) {
                        if (this.textField.isExpanded) {
                            // Let combo box or date field first remove the popup
                            return;
                        }
                        // No idea why the defer is necessary, but otherwise the call to setValue('') is ignored

						// 2011-11-30 Ing. Leonardo D'Onofrio leonardo_donofrio at hotmail.com
						if (this.textField.clearValue) {
							Ext.Function.defer(this.textField.clearValue, 1, this.textField);
						} else {
							Ext.Function.defer(this.textField.setValue, 1, this.textField, ['']);
						}
                        // end Ing. Leonardo D'Onofrio
						e.stopEvent();
                    }
                },
                this);
        }
function() {
            if (!this.clearOnEscape) {
                return;
            }

            // Using a KeyMap did not work: ESC is swallowed by combo box and date field before it reaches our own KeyMap
            this.textField.inputEl.on('keydown',
                function(e) {
                    if (e.getKey() == Ext.EventObject.ESC) {
                        if (this.textField.isExpanded) {
                            // Let combo box or date field first remove the popup
                            return;
                        }
                        // No idea why the defer is necessary, but otherwise the call to setValue('') is ignored

						// 2011-11-30 Ing. Leonardo D'Onofrio leonardo_donofrio at hotmail.com
						if (this.textField.clearValue) {
							Ext.Function.defer(this.textField.clearValue, 1, this.textField);
						} else {
							Ext.Function.defer(this.textField.setValue, 1, this.textField, ['']);
						}
                        // end Ing. Leonardo D'Onofrio
						e.stopEvent();
                    }
                },
                this);
        }
function ( ) { if ( ! this . clearOnEscape ) { return ; } // Using a KeyMap did not work: ESC is swallowed by combo box and date field before it reaches our own KeyMap this . textField . inputEl . on ( 'keydown' , function ( e ) { if ( e . getKey ( ) == Ext . EventObject . ESC ) { if ( this . textField . isExpanded ) { // Let combo box or date field first remove the popup return ; } // No idea why the defer is necessary, but otherwise the call to setValue('') is ignored // 2011-11-30 Ing. Leonardo D'Onofrio leonardo_donofrio at hotmail.com if ( this . textField . clearValue ) { Ext . Function . defer ( this . textField . clearValue , 1 , this . textField ) ; } else { Ext . Function . defer ( this . textField . setValue , 1 , this . textField , [ '' ] ) ; } // end Ing. Leonardo D'Onofrio e . stopEvent ( ) ; } } , this ) ; }
If config option "clearOnEscape" is true, then add a key listener that will clear this field
If config option clearOnEscape is true then add a key listener that will clear this field