I want to load item/items from ViewController. Here is an example:
Ext.define('MyApp.model.User', {
extend: 'Ext.data.Model',
fields: ['name', 'email'],
proxy: {
type: 'rest',
...
}
});
Ext.define('MyApp.store.User', {
extend: 'Ext.data.Store',
model: 'MyApp.model.User',
data : [
{firstName: 'Seth', age: '34'},
{firstName: 'Scott', age: '72'},
{firstName: 'Gary', age: '19'},
{firstName: 'Capybara', age: '208'}
]
});
Ext.define('MyApp.view.MainController', {
extend: 'Ext.app.ViewController',
alias: 'controller.main',
init: function() {
//how to access store here and load items, using its load() method?
//how to access model here and load an item, using its load() method?
}
});
- How to access store from here and load items, using its load() method?
- How to access model and load an item using its load method?