2011-11-27 2 views
4

이벤트 후 콤보 상자의 내용을 확장하려고합니다.ExtJs ComboBox 자동 확장

Ext.onReady(function(){ 

var mycb = new Ext.form.ComboBox({ 
    //params 
}); 

//here is other event 
var other = .... 
    onChange: function() { 
    //here I'm trying to expand 
    mycb.expand(); 
} 
}); 

그러나 expand() 및 검색 조건에 '*'reqex를 입력 한 후에는 확장 목록이 없습니다. 나는 'minChars'매개 변수를 0으로 설정하려고했지만 그 결과도 없습니다.

답변

1

확장하기 전에 콤보의 저장소를로드하십시오. 당신이 자동 콤보 상자 목록을 확장하려면

2

, 당신은 ") onTriggerClick를 ("사용할 수 있습니다

Ext.onReady(function(){ 

    var mycb = new Ext.form.ComboBox({ 
    // params 
    listeners: { 
     afterrender: function (cb) { 
      cb.onTriggerClick(); 
     } 
    } 
    }); 

}); 

이 예제 자동 후 렌더링 콤보 상자의 내용을 확장 ...

1

전화 확장() after load().

listeners: { 
    change: function (obj, newValue, oldValue, eOpts) { 
     store.proxy.extraParams.keyword = newValue; 
     store.load(); 
     this.expand(); 
    } 
} // listeners 
1

다음 코드는 extjs3.3에서 작동합니다. 어떤 사람을 도울 수 있습니까?

var taxonomyTreePanel = new Ext.form.ComboBox({ 
     id: 'taxTreePanel', 
     store:new Ext.data.SimpleStore({fields:[],data:[[]]}), 
     editable:false, 
     //z-index: 7000, 
     typeAhead:false,//done by siddhartha 
     selectOnFocus:true, 
     shadow:false, 
     mode: 'local', 
     triggerAction:'all', 
     maxHeight: 200, 
     width: 340, 
     emptyText:"Select Resource Category", 
     tpl: '<tpl for="."><div style="height:210px"><div id="taxonomyTreediv"></div></div></tpl>', 
     selectedClass:'', 
     forceSelection: true, 
     onSelect:Ext.emptyFn, 
     listeners: { 
      afterrender: function (obj) { 
       if(singleParamDynamicQuery &&docTypeCodeDynamciQuery.length>0){ 
        obj.onTriggerClick(); 
       } 
      } 
     }, 
     onViewClick : function(doFocus){ 
     //do nothing 
     } 
     });