PDA

View Full Version : Set values in combo box



taxidriver
26 Oct 2010, 8:30 AM
Hello guys,

I've a Ext.form.FormPanel where there are textfields and 1 combobox.
These controls should be filled with json data after page is rendering.
Each of the above controls has a unique name in order to use the expressions:

Ext.getCmp('myform').getForm().setValues({text1: 'sometext1' },.....);
Ext.getCmp('myform').getForm().getFieldValues(true);

for setting and retrieving data correspondingly.

As far as it concerns the textfields all seems to be OK, but there exist a problem with the combobox:
The combobox has as config attributes A)a displayField b)a valueField C)a name and an empty data store on loading.

My question is if it is possible to set custom valueField for any combo store record, e.g.
To set the name it is possible to call Ext.getCmp('myform').getForm().setValues({name: 'name1' });
Is it possible to pass in parallel a corresponding id, in order to be used as valueField in combo?