View Full Version : a simple and newbie question

25 Oct 2010, 2:27 AM
if I implement a store with a storeId, shall I be able to get the reference of this store by the method "Ext.getCmp" ?

var combostore = new Ext.data.Store( {
storeId = 'combo';

Shall this work :

var combo = Ext.getCmp('combo');

25 Oct 2010, 2:31 AM
No, a store is not a component.

You can get a store from it's storeId by using Ext.StoreMgr.get(storeId).

25 Oct 2010, 2:49 AM
Hi condor and thank you for your answer.

I have a second question : is it possible to use a same store for 2 different combo, so that when you load once the store for the first combo, you don't have to load it for the second combo ?

25 Oct 2010, 3:11 AM
You can, but only for triggerAction:'all' comboboxes (otherwise the combobox will filter the store while typing, which affects the second combobox).