我有一个MVC应用程序,工具栏,tabpanel和导航面板绑定到视口。在工具栏中,我需要一个注销按钮,其中包含会话用户的名称。所以我请求服务器。我将商店和模型设置到我的工具栏控制器:
Ext.define('Cc.controller.Headers', {
extend: 'Ext.app.Controller',
stores: ['Person'],
models: ['Agent'],
views: ['Header'],
refs: [
{ ref: 'head', selector: 'head' },
{ ref: 'logoutButton', selector: 'head button[action=logout]'}
],
init: function() {
this.control({
'head button[action=logout]': {
beforerender: this.initLogoutButton
}
});
},
initLogoutButton: function(a){
this.getPersonStore().load();
var store = this.getPersonStore().each(),
button = this.getLogoutButton();
**//how to bind data to the button ?**
}
});