View Full Version : How loose the focus by an Ext.form.ComboBox

10 Feb 2011, 1:13 AM
Hi all,
I need your help for a question apparently easy...

I have a gridPanel loaded by a PagingJSONStore. This GridPanel has a toolbar with one or more combobox linked to the same grid's store to filter they data. This gridPanel is refreshed automatically every tot seconds.

All works fine, BUT a little problem appears when the user select a value from a combo because it's opened on each refresh of data. This problem disappears if the user click out of the combo after the selection.

So, I'd like to force a blur of the focus on the combo after the selection, so I wrote some code as:

var combDefaultConfig = {
width: 130,
typeAhead: true,
triggerAction: 'all',
validateOnBlur: false,
mode: 'local'

var cb = new Ext.form.ComboBox(
Ext.apply(combDefaultConfig, {
store: s,
index: dataIndex,
listeners: {
'select': {
fn: function(combo, record, index) {
var field = combo.index;
var exp = record.get(combo.valueField);
this.onFilterSelect(field, exp);
//this.fireEvent('blur', this, this.lostFocus());
this.fireEvent('blur', this);

scope: this
And than in the parent of the combo I write a method on this event:

this.filterBar.on('blur', function() {
}, this);BUT this doesn't solve my problem. The combobox is ever opened on the refreshdata . Someone has some helps? I need it!!

Thanks in advance,