如何禁用Ext JS按钮

Dim*_*tri 10 extjs

我有一个id为的按钮,btnAdd我希望在某些事件被触发时禁用它.某些窗口关闭时会发生该事件.所以我尝试了以下代码,但它不起作用.

Ext.create('Ext.window.Window', {
    // Some initialization code goes here...
    listeners: {
       close: function(panel, eOpts){
          Ext.get('btnAdd').disable(); // this does not work;
          Ext.get('btnAdd').setDisabled(); // this one does not either
          Ext.get('btnAdd').disabled = true; // And this one also seems to do nothing
       }
    }
});
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?这可能看起来很容易,但不要判断我的不好.我对Ext JS很新.我也无法在API文档中找到答案.