0

我有一个带有工具栏、选项卡面板和导航面板的 MVC 应用程序绑定到视口中。在工具栏中,我需要一个带有会话用户名称的注销按钮。所以我请求服务器。我为我的工具栏控制器设置了一个商店和一个模型:

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 ?**
  }
});
4

0 回答 0