I have store that I would like to initialize from a database but I couldn’t find a standard init method for the Ext.data.Store. I found a couple of examples with the StoreManager component, but I think that’s not what I’m looking for. I have an MVC structure for my app and I’d like to keep it, I only want to initialize my store’s data field using a method I define. Could someone explain how to do so?
I have store that I would like to initialize from a database but I
Share
I either understand you wrong or your question is straight forward. You configure a store with a model like this. That’s all. You may just chose a provider(reader/writer) that fit your needs.
Note that the reader will expect a Json result like this:
and is referring to a url like
Place the store as ‘User’ within the controller store array and retrieve it within the Controller by calling
getUserStore()or directly from the Ext.StoreMgr using Ext.StoreMgr.lookup(‘User’);Note that by convention the Controller (MVC) will override any storeId you set on the store and will just use the name.