ExtJS4 - MVC Toolbar with JSON bind into a button
I have an MVC application with toolbar, tabpanel and navigation panel bind into a viewport. In the toolbar, I need to have a logout button with the name of the user of the session. So I request the server. I set a store and a model to my toolbar controller :
Ext.define('Cc.controller.Headers', {
extend: 'Ext.app.Controller',
stores: ['Person'],
models: ['Agent'],
views: ['Header'],
refs: [
{ ref: 'head', selector: 'head' },
{ ref: '开发者_StackOverflowlogoutButton', 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 ?**
}
});
精彩评论