我有一个带有一些按钮的工具栏,其中一个按钮需要在创建时不可见,并且在我的应用程序中的某个位置可见。
我目前正在添加需要可见的按钮,但这并不是我想要的。
创建按钮时,您可以hidden: true
在配置中进行设置。
或者,您可以在添加按钮后立即“隐藏()”按钮,然后稍后再“显示()”按钮。
find the button and make it invisible
Ext.create('Ext.toolbar.Toolbar', {
renderTo: document.body,
width : 400,
items: [
{
text: 'Button',
id: 'my-btn',
hidden: true
},
{
xtype: 'splitbutton',
text : 'Split Button'
},
'->',
{
xtype : 'textfield',
name : 'field1',
emptyText: 'enter search term'
}
]
});