PDA

View Full Version : toolbar and ComboBox



fandreacci
24 Sep 2007, 5:48 AM
var tb = new Ext.Toolbar('toolbar', [] );

var store = ....

var combo = new Ext.form.ComboBox({
store: ds,
displayField:'NOME',
typeAhead: true,
mode: 'remote',
triggerAction: 'all',
emptyText:'Unidade',
selectOnFocus:true,
width:135
});

combo.on('change',function(t){alert('oi')});

tb.addField(combo);



why I can't see the alert when I change the combo?

:S

tks

catacaustic
24 Sep 2007, 10:51 PM
When you specified the "change" event, what are you trying to capture? There is "change" and there is "select" events and they are close, but not the same.

The "select" event will fire as soon as something is selected in the ComboBox.

The "change" event only fires after the value has changed from a previous selection, and you've moved the focus away from the ComboBox to some other element. If the focus remains on the ComboBox, the "change" event won't fire.