PDA

View Full Version : hideTrigger not working on an autosuggest combo box



sdiama
28 Mar 2010, 1:08 AM
I have the following code to autosuggest a country/city/area selection.



var geoSuggestOptions = new Ext.form.ComboBox({
store: ds,
typeAhead: false,
forceSelection: true,
loadingText: 'Loading...',
width: 500,
minChars: 3,
hideTrigger: true,
queryParam: 'locstr',
applyTo: 'acGeoSearch',
queryDelay: 0,
itemSelector: 'div.search-item',
displayField: 'geoname',
valueField: 'geoname',
tpl: resultTpl,
enableKeyEvents: true,
queryIgnoreCase: true,
onSelect: function(record){
preSelectCountryObj.country = record.data.countryid;
preSelectCountryObj.city = record.data.cityid;
preSelectCountryObj.area = record.data.areaid;
preSelectCountryObj.weathercode = record.data.weathercode;
preSelectCountryObj.geoname = record.data.geoname;
if (preSelectCountryObj.city == '') {preSelectCountryObj.city = 0;}
if (preSelectCountryObj.area == '') {preSelectCountryObj.area = 0;}
this.setValue(record.data.geoname);
this.collapse();
},
onKeyPress: function(e) {
var keyPressed = e.getCharCode();
// allow only backspace, space, del, enter, [arrows], [home-end-pgup-pgdn], [a-z], [A-Z]
if ( keyPressed == 8 || keyPressed == 32 || keyPressed == 46 || keyPressed == 13 ||
(keyPressed >= 37 && keyPressed <= 40) ||
(keyPressed >= 33 && keyPressed <= 36) ||
(keyPressed >= 65 && keyPressed <= 90) ||
(keyPressed >= 97 && keyPressed <= 122) ) {
return true;
} else {
e.stopEvent();
el = Ext.get('dlgSearchWhereString');
el.applyStyles('font-weight:bold');
el.syncFx();
el.highlight();
el.frame("ff0000", 1, { duration: 1, afterStyle: 'font-weight:normal' });
}
}
});


The problem is that the hideTrigger config option is not working in 3.1.1. It was working fine on 2.2.1

Any suggestions?