我有一个带有处理程序onLogin()的Controller,它在成功登录请求后被调用:
Ext.define('AddressBook.controller.Application', {
extend: 'Ext.app.Controller',
...
onLogin: function(form, record) {
var editButton = this.getEditButton();
if (!this.showContact) {
this.showContact = Ext.create('AddressBook.view.contact.Show');
}
//how to get this store?
var store = getContactsStore();
//how to get the data in the store or should I get the model?
this.showContacts.updateDataProvider(store.array);
// Push the show contact view into the navigation view
this.getMain().push(this.showContact);
},
...
}
答案 0 :(得分:3)
试试这段代码
Ext.getStore('storeId')
它会给你商店的对象