Nico
Nico

Reputation: 1081

Howto fill combobox with array in ExtJS

I am struggling with a problem in ExtJS 4...

I have an array like this:

[ 2010, 2011,2012 ]

And I would like to fill my combobox with these values. I can set the first value with combobox.setValue() but I want to set several values. This is my combobox:

var combobox = Ext.ComponentQuery.query('combobox[name=myBox]')[0];

Does someone know how I can populate the combobox with the array?

Upvotes: 1

Views: 7342

Answers (1)

Vinit Prajapati
Vinit Prajapati

Reputation: 1613

See this

Ext.create('Ext.form.field.ComboBox', { store: ['Red', 'Yellow', 'Green', 'Brown', 'Blue', 'Pink', 'Black'] });

Ref: http://skirtlesden.com/articles/extjs-comboboxes-part-1

Upvotes: 4

Related Questions