PDA

View Full Version : combo box not populated with default value



ruchika
11 Oct 2009, 11:10 AM
Hello Everyone,
I need help to resolve the below issue.
I am trying to populate a combo box and want the combo box to be populated with the first value.Below is an example where I am trying to populate with some static values, I expect test1 to be displayed in combo boxes by default.

var groupStore1 = new Ext.data.SimpleStore({
fields: ['testDisp', 'testValue'],
data : [['test1', 'test1'], ['test2', 'test2'], ['test3', 'test3']]
});


var combo1 = new Ext.form.ComboBox({
store: groupStore1,
displayField:'testDisp',
valueField: 'testValue',
typeAhead: true,
triggerAction: 'all',
selectOnFocus:true,
renderTo:'filterData1',
width: 180,
mode: 'local',
fieldLabel: 'GROUPList'
});

When I use the above code an empty option is displayed as default.Pls let me know how can I display test1 as a default value.

Thanks
Ruchika

aconran
11 Oct 2009, 8:51 PM
Use value: 'test1'