PDA

View Full Version : combo box question.



muncher
8 Jul 2010, 10:18 AM
I have a xml file as folows


..
<operatingsystem><id>3</id><name>Unix</name></operatingsystem>
<operatingsystem><id>3</id><name>Unix</name></operatingsystem>
..



and the corresponding combobox with following settings -



var osCombo = new Ext.form.ComboBox({
id: 'osCombo',
store: osStore,
displayField: 'name',
valueField: 'id',
hiddenName : 'osId',
typeAhead: true,
mode: 'local',
fieldLabel: 'OperatingSystems',
anchor: '100%',
forceSelection: true,
triggerAction: 'all',
emptyText:'Select an OS...',
selectOnFocus:true
});



I want hiddenvalue field to be set to
<id>3</id><name>Unix</name>

how do I do that ? My store mapping looks like -


...
...
fields: [
// the 'name' below matches the tag name to read, except 'availDate'
// which is mapped to the tag 'availability'
{name: 'id', type: 'string'},
...
...