It seems like I may have misunderstood you, or your question is quite straightforward. To set up a store with a model, you simply configure it as shown below. You can choose a provider (reader/writer) based on your requirements.
// Defining a model for our Store
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{name: 'firstName', type: 'string'},
{name: 'lastName', type: 'string'},
{name: 'age', type: 'int'},
{name: 'eyeColor', type: 'string'}
]
});
Ext.define('YourMVCNameSpace.data.UserStore', {
extend: 'Ext.data.Store',
constructor: function (config) {
config = Ext.Object.merge({}, config);
var me = this;
// Manipulate the configuration object as needed before passing it to the parent constructor
me.callParent([config]);
// Proceed with using the modified config object
},
model: 'User',
proxy: {
type: 'ajax',
url: '/users.json',
reader: {
type: 'json',
root: 'users'
}
},
autoLoad: true
});
Keep in mind that the reader expects a JSON result in the following format:
{"total": 55, "users":["...modeldata.."]}
The URL referenced by the reader should be something like
http://localhost/YourAppDomain//users.json
Include the store named 'User' in the controller's store array and access it in the Controller using getUserStore()
or directly from the Ext.StoreMgr by calling Ext.StoreMgr.lookup('User');
Remember that the Controller in the MVC structure will ignore any storeId you specify and use the name of the store instead.