PDA

View Full Version : Reset ComboBox after listerner works



blade226
21 Aug 2012, 5:01 AM
Hi,

I have a ComboBox with a listerner


var dropbox = Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Casemanager',
id: 'casemanager',
store: mystorecm,
width: 300,

queryMode: 'local',
displayField: 'zusammen',
valueField: 'pid',
listeners:
{
scope:this,

select: function()
{
var mon = Ext.getCmp('monate').getValue()
var sub = Ext.getCmp('casemanager').getValue()
var auswahl = Ext.getCmp('auswahl').getValue()
........


After select a new window opened. But the selected value remains in the combobox and can not twice selected.
How can i reset the combobox?

redraid
21 Aug 2012, 5:04 AM
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.ComboBox-method-clearValue

sword-it
21 Aug 2012, 5:51 AM
Hi blade226,
You can try the code give below:



listeners:{
select:function(combo,record){
var selectedValue = combo.getValue();
combo.setValue('');
}
}