PDA

View Full Version : [CLOSED] Getting ComboBox ValueField with ExtJS



extnetuser
Jul 04, 2013, 4:50 PM
I would like to know if it is possible to get the ValueField of the selected Value for a ComboBox.

Example :

I have a ComboBox named DFE.

I add the ValueField and DisplayedValue to its store by using the following code :


var store = Ext.getCmp('DFE').getStore();
store.add({ field1: input.id, field2: input.value });

I can access the value of the valuefield or the displayfield using the following commands :


Ext.getCmp('DFE').store.data.items[i].data.field1
Ext.getCmp('DFE').store.data.items[i].data.field2

field1 - ValueField
field2 - DisplayValue

But how can I get the valueField for the SELECTED value of the ComboBox?
Thank you.

Daniil
Jul 04, 2013, 5:11 PM
Hi @extnetuser,

Seems, a ComboBox's getValue method is what you are looking for.

App.ComboBox1.getValue();