View Full Version : Problem by getting the value of a combo in a tbar

22 Sep 2010, 9:26 AM
Hello !!

My problem is the following one:

I have integrated a combo in a tbar of a TabPanel like this:

xtype: 'combo',
store: adminsCombo,
id: 'adminCombo',
hiddenName: 'adminId',
valueField: 'id',
displayField: 'name',
typeAhead: true,
mode: 'local',
triggerAction: 'all',

On the right side of this combo I have placed a button in the tbar with the following handler:


But now I am getting the displayField-Value.
Is it also possible to get the valueField-Value?

22 Sep 2010, 9:48 AM
Your problem is with the Ext.get() method. It is getting the elements underlying value as it is in the DOM. Try this.


22 Sep 2010, 9:51 AM
I would however suggest checking out the following forum posting

The solution using the Ext.getCmp() method will work but there are better ways to structure your code so that you dont have to use this method. However in the end you have to use what works for you.