combobox - Extjs : Selecting same value in multiselect combo not removing value -


i using ext5 multiselect combo. if select value dropdown, 'other' , click outside cancel dropdown. value 'other' shown in combo. again click dropdown , select tha same value 'other', should remove 'other' values. rather adds same value once again.

here image: code given below:

        xtype: 'combo',         emptytext: 'retail bi',         name: 'chainrefid',         store: ext.create('shared.store.filter.chainrefs'),         displayfield: 'name',         multiselect: true,         valuefield: 'chain_ref_id',         listeners: {             expand: function(){                                  this.getstore().load();                 },             change: function(combo, newval) {                 if (!combo.eventssuspended) {                     var storecombo = ext.componentquery.query('combo[name=storeid]')[0];                     storecombo.getstore().removeall();                     storecombo.setvalue(null);                     var chaincombo = ext.componentquery.query('combo[name=chainid]')[0];                     chaincombo.getstore().removeall();                     chaincombo.setvalue(null);                                           }             }         } 

is there solution this? in advance.

your combo's store gets reloaded on each expand. technically record corresponding value selected first time disappears on second store load, removing logic not "see" , therefore leaves in field.

remove this:

expand: function(){                      this.getstore().load();     } 

, use autoload: true on store.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -