PDA

View Full Version : menu and grid



wehtam
7 Apr 2008, 3:52 AM
Hello
In my grid I have a tbar like this :

tbar : [ new Ext.form.ComboBox({
fieldLabel: 'Zone géographique',
store: new Ext.data.SimpleStore({
fields: ['id', 'libelle'],
data : Ext.dataZoneGeoOffresSpeciales.Zone // from states.js
}),
displayField:'libelle',
valueField: 'id',
id : 'zone',
hiddenName: 'IdZoneGeoOffresSpeciales',
typeAhead: true,
labelStyle: 'width:170px;',
mode: 'local',
triggerAction: 'all',
emptyText:'Choisir...',
selectOnFocus:true,
forceSelection: true,
width: 250,
allowBlank:false
}),{
text:'Nouvelle offre spéciale',
tooltip:'Ajouter une nouvelle offre spéciale',
iconCls:'add',
handler: addCate
}]

I would like call a function when I select a value in may combobox, how can I do that ?
Thanks

dj
7 Apr 2008, 4:46 AM
ComboBox (http://extjs.com/deploy/dev/docs/?class=Ext.form.ComboBox) has a change or select event that you want to subcribe to.

add something like


listeners:{
change:function(combo, ewVal, oldVal) {
// do something
}
}

to the config of your ComboBox.

wehtam
7 Apr 2008, 11:30 PM
thanks =D>=D>=D>