ExtJs ComboBox automatically expands

I am trying to expand the contents of a combo box after an event.

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

But after expand () and placing '*' reqex for the search terms, there is no expanding list. I tried using the minChars parameter set to 0, but the results are also missing.

+4
source share
4 answers

If you want to automatically expand the comboBox list, you can use "onTriggerClick ()":

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

This example automatically expands the contents of your combo box after rendering ...

+2
source

Try loading combo storage before expanding it.

+1
source

Call expand () after loading ().

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

Below code works for me on extjs3.3. can this help someone

 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 } }); 
+1
source

Source: https://habr.com/ru/post/1383313/


All Articles