I m trying to create multiple combo boxes on button click event and I wanted to set different values to it. And all of these combos have same store. But i cant set values to these combos.
1 Answer
You can easily set combobox value in its configuration by value config option.
var count = 0;
var btn = Ext.create('Ext.Button', {
text: 'Click me',
handler: function() {
count++;
var combo = Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
displayField: 'name',
value: count,
valueField: 'id'
});
container.add(combo);
}
});
Check this fiddle: Fiddle with live example