Ext 2.xcombo keyup 이벤트에 응답할 수 없음

3070 단어 combo

  Ext.override(Ext.form.ComboBox, {
            initEvents : function(){
                Ext.form.ComboBox.superclass.initEvents.call(this);
                this.keyNav = new Ext.KeyNav(this.el, {
                    "up" : function(e){
                        this.inKeyMode = true;
                        this.selectPrev();
                    },
                    "down" : function(e){
                        if(!this.isExpanded()){
                            this.onTriggerClick();
                        }else{
                            this.inKeyMode = true;
                            this.selectNext();
                        }
                    },
                    "enter" : function(e){
                        this.onViewClick();
                        this.delayedCheck = true;
                        this.unsetDelayCheck.defer(10, this);
                    },
                    "esc" : function(e){
                        this.collapse();
                    },
                    "tab" : function(e){
                        this.onViewClick(false);
                        return true;
                    },
                    scope : this,
                    doRelay : function(foo, bar, hname){
                        if(hname == 'down' || this.scope.isExpanded()){
                           return Ext.KeyNav.prototype.doRelay.apply(this, arguments);
                        }
                        return true;
                    },
                    forceKeyDown : true
                });
                this.queryDelay = Math.max(this.queryDelay || 10,
                        this.mode == 'local' ? 10 : 250);
                this.dqTask = new Ext.util.DelayedTask(this.initQuery, this);
                if(this.typeAhead){
                    this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this);
                }
                if((this.editable !== false) && !this.enableKeyEvents) {
                    this.el.on("keyup", this.onKeyUp, this);
                }
                if(this.forceSelection){
                    this.on('blur', this.doForce, this);
                }
            },
            onKeyUp : function(e){
                if(this.editable !== false && !e.isSpecialKey()){
                    this.lastKey = e.getKey();
                    this.dqTask.delay(this.queryDelay);
                }
                Ext.form.ComboBox.superclass.onKeyUp.call(this, e);
            }
        });

구성상

	enableKeyEvents: true,
   	listeners:{
	   "keyup":function(f){
	
	    }
  	}

좋은 웹페이지 즐겨찾기