开发者

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜