PDA

View Full Version : combobox and setValue



flamant
16 Sep 2010, 12:51 AM
Hi,
I have the following combobox with a displayField and valueField


formField = new Ext.form.ComboBox({
.............................
store: comboStore,
displayField: 'name',
valueField: 'id',
...........................
});
and the comboStore has the following Record



comboRecord = Ext.data.Record.create([
{name: 'id'},
{name: 'name'}
]);
I receive by an ajax request the value corresponding to the 'name' attribute and I would like to set the value of the combobox with the id corresponding to the 'name' attributes. How can I do this.
I presume that the methods "setValue (http://dev.sencha.com/deploy/dev/docs/source/Field.html#method-Ext.form.Field-setValue)" and "setRawValue (http://dev.sencha.com/deploy/dev/docs/source/Field.html#method-Ext.form.Field-setRawValue)" only set the value corresponding to the 'id' (and I only have the 'name' attribute)
Thank you in advance for your answers