user2000423
user2000423

Reputation: 101

How can I bind a store to Combobox

How can I bind a store to Combobox by using combobox ID like:

Ext.getCmp('combobox-id').store(unitStore);

name of combpobox-"configuration-unit-form-select-Merge-with-unit" store is-"unitStore"; IN extjs 3.4

Upvotes: 1

Views: 5724

Answers (2)

Ankit
Ankit

Reputation: 338

Ext.getCmp(id) takes id as parameter not name so, that is the first change you should make. Doc Link

Considering configuration-unit-form-select-Merge-with-unit as an id property of Combo try below

Ext.getCmp('configuration-unit-form-select-Merge-with-unit').store.loadData(unitStore);

Upvotes: 2

VoidMain
VoidMain

Reputation: 2047

Do it like this:

Ext.getCmp('comboid').bindStore(unitStore);

Thats the proper way of binding a store to an existent combo.

Upvotes: 2

Related Questions