PDA

View Full Version : Blur Combo on select event



bernd01
14 May 2013, 1:57 AM
Hi,

is there a solution to automatically blur a combobox after selecting a value in the combo?
Now I always have to click somewhere else in the browser, to blur the combo.

Background for this question is, that I need to use the 'change' event, which only will be called after blurring the combo.

This happens also with the combo samples of ext js 3.2. and also 4.x.

After 4 hours of debugging, and trying workarounds (e.g. programatically focusing other elements) I still did not find an answer.

Any help would be really appreciated!

Best regards,
Bernd

rich02818
14 May 2013, 3:52 AM
Be very careful in using the ComboBox blur event. See http://www.sencha.com/forum/showthread.php?244633

To cause a blur event when the user selects from the dropdown list I have the following within my ComboBox 'select' event handler:

[ (http://www.sencha.com/forum/showthread.php?244633)code]

if (c.triggerBlur){
c.triggerBlur();
if (enableLogger) {Ext.ux.Logger.debug('3-triggerBlur');}
}else{
c.getEl().blur();
if (enableLogger) {Ext.ux.Logger.warning('3-blur');}
}

[/code]

bernd01
14 May 2013, 7:13 AM
Hi Rich,

Thanks for your answer. triggerBlur() really does the job, firing my 'change' event.

Best regards,
Bernd