http://www.sencha.com/blog/deep-dive...ext-js-5-data/
{
makeStore: function(configuration) {
var storeId = configuration.name;
var store = 'System.store.gridEditor.' + Ext.String.capitalize(configuration.name);
Ext.define(store, {
extend: 'System.store.gridEditor.Store',
storeId: storeId,
model: this.makeModel(configuration)
});
Ext.create(store);
return storeId;
},
makeModel: function(configuration) {
var model = 'System.model.gridEditor.' + Ext.String.capitalize(configuration.name);
Ext.define(model, {
extend: 'System.model.gridEditor.Model',
fields: this.makeFields(configuration),
proxy: {
url: configuration.api + configuration.name + '/',
reader: {
type: 'json',
rootProperty: 'data',
totalProperty: 'totalCount',
messageProperty : 'error'
}
}
});
return model;
}
}