View Full Version : Referencing stores added in the ViewModel

31 Oct 2017, 4:32 PM

In SA, how do I set the a ComboBox store property to a store added to the ViewModel stores collection ?

I have a form with a combobox and I want to hook it to the ViewModel store. I tried to do it by name (I assigned the store name property) but it doesn't work. I also noticed that stores added to a ViewModel don't have the storeId property.

If I add the store to the app (i.e. it appears in the app stores collection) I can assign the storeId and I can reference it by the storeId (in other words I set the combobox store property to the storeId).

On top of all this now I started to get the "invalid source - guid - specified by Ext.data.ChainedStore" as I posted in another thread (https://www.sencha.com/forum/showthread.php?301866-Framework-Error-Invalid-source-quot-fxxxx-quot-specified-for-Ext-data-ChainedStore&p=1314423&viewfull=1#post1314423). The UI doesn't show up anymore.

Any suggestions?

Thank you

31 Oct 2017, 10:43 PM
ok, I figured it out based on this article: https://joekuan.wordpress.com/2016/02/12/sencha-architect-how-to-use-viewmodel-to-bind-store-into-grid-panel/.

The Store attribute is assigned the value {StoreName} (StoreName is the name of the store in the view model) and then the little magnet icon is clicked to enable the binding to the view model store (the magnet becomes red).