PDA

View Full Version : ComboBox select event question



wolfljj
23 Mar 2010, 6:28 PM
i add a listeners to a combobox, new a window when the first item was selected
the new window has some button .
then i want clear the combobox when button(in new widow) click
but the first click will let combobox show the first item,second click can be ok and the combobox will show the first item when the window was clicked.why??
please help me!!thank you very much!!

the code like this:

layout: 'form',items: [{id: 'txtSpYs',xtype: 'combo',editable: false,fieldLabel: 'test',
mode: 'local',triggerAction: 'all',displayField: 'Name',valueField :'ID',
store: clrCmbStore,anchor: '82%',
listeners: { 'select': function(combo, record, index) {
if (index == 0) {
var winColorMain = new Ext.Window({width: 310,
height: 310,modal: true,items: [{xtype: 'button',
text: 'del',
iconCls: 'edit',
iconAlign: 'top',
width: 50,
listeners: { 'click': function() { combo.clearValue(); }}
}]
});}}}

tvanzoelen
24 Mar 2010, 12:03 AM
I have no idea what you want, but try to use combo.setValue('')