ExtJs ツールバー内に 4 つのボタンがあります。このボタンのコードは次のようになります。
MyToolbarUi = Ext.extend(Ext.Toolbar, {
buttonAlign: 'right',
width: 813,
height: 32,
id: 'toolbar',
initComponent: function() {
this.items = [
{
xtype: 'buttongroup',
title: '',
columns: 2,
width: 250,
layout: 'column',
baseCls: ' ',
id: 'buttongroup',
items: [
{
xtype: 'button',
text: ' B1',
width: 50,
ref: '../b1',
id: 'b1_id'
},
{
xtype: 'button',
text: 'B2',
width: 50,
ref: '../b2',
id: 'b2_id'
},
{
xtype: 'button',
text: 'B3',
width: 50,
ref: '../b3',
id: 'b3_id'
},
{
xtype: 'button',
text: 'B4',
width: 50,
ref: '../b4',
id: 'b4_id'
}
]
}
];
MyToolbarUi.superclass.initComponent.call(this);
}
});
上記のコードには、b1、b2、b3、および b4 を呼び出す 4 つのボタンがあり、プログラムで次のコードを非表示にしようとしています。
最初の試行:this.b4.hidden = true;
2回目の試行:var btn= Ext.getCmp('b4_id'); btn.setVisible(false);
両方の方法の上に、4つのボタンすべてが隠されています。プログラムでB4ボタンのみを非表示にするにはどうすればよいですか? 上記の隠された双方向の何が問題なのか説明してください。