Reputation: 16847
I have a toolbar with some buttons and one of the buttons needs to be invisible at creation and visible at some point in my app.
I'm currently adding the button when it needs to be visible but that is not exactly what I want.
Upvotes: 4
Views: 10389
Reputation: 19163
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'
}
]
});
Upvotes: 1
Reputation: 20047
When you create the button you can set hidden: true
in the config.
Or you can 'hide()' the button soon after adding it and then 'show()' it at a later date.
Upvotes: 8