Khirthan
Khirthan

Reputation: 197

Create Multiple Comboboxes dynamically in ExtJS

I need to create approximately 8 Comboboxes. I don't want to be static and it should be called dynamically using Ext-JS.

Upvotes: 1

Views: 1354

Answers (1)

A1rPun
A1rPun

Reputation: 16857

This piece of code creates a couple of comboboxes dynamically. I hope this is what you was looking for.

for (var i=0; i < 8; i++) {
    Ext.create('Ext.form.ComboBox', {
        fieldLabel: 'Combobox '+i,
        store: ['Option1','Option2'], //better to use a dynamic store
        renderTo: Ext.getBody()
    });
};

Upvotes: 3

Related Questions