PDA

View Full Version : Getting ComboBox Value



brunomaia
8 Apr 2010, 7:29 AM
Hi,

I have a problem getting a value from ComboBox using Ext.getCmp().

Example:


var combo = new Ext.form.ComboBox({...});

combo.on('change', function(a) {
alert(a.getValue()); //return the changed value
alert(Ext.getCmp(a.getId()).getValue()); //return nothing (empty value)
});

Any Idea?

steffenk
8 Apr 2010, 7:44 AM
Ask the docs ;)
http://www.extjs.com/deploy/dev/docs/?class=Ext.form.ComboBox
See the arguments you have in change event:
change : ( Ext.form.Field this, Mixed newValue, Mixed oldValue )

jay@moduscreate.com
8 Apr 2010, 8:02 AM
my firs idea is to stop devugging with alert.

second is to look at the API as steffen alluded to.