当我隐藏按钮所有按钮隐藏与buttongroup时,我在buttongroup内有四个按钮。这个错误是ExtJs3还是我做过的事情?
我用于隐藏按钮
var theSameButton = Ext.getCmp('my_button_id');
theSameButton.hide();
答案 0 :(得分:1)
我认为“my_button_id”是您的按钮组ID。你可以发布你的代码吗? 如果你只想隐藏一个按钮,请尝试下面的代码。
Ext.onReady(function(){
var Window = new Ext.Window(
{
width : 340,
height : 150,
iconCls : 'upload',
defaults : {
bodyStyle : 'padding:0px'
},
items : [{
xtype: 'buttongroup',
id:'buttonGrp',
items: [{
text: 'Paste',id:'button1',handler : function(){ Ext.getCmp('button2').hide();}
},{
text: 'Copy',id:'button2'
},{
text: 'Format',id:'button3'
}]
} ]
});
Window.show();
});