How to create a button originally hidden in ExtJS?

I have a toolbar with some buttons, and one of the buttons should be invisible when created and visible at some point in my application.

I am currently adding a button when it should be visible, but that’s not quite what I want.

+4
source share
2 answers

When creating the button, you can set hidden: true to config.

Or you can "hide ()" the button shortly after adding it, and then "show ()" it later.

+8
source
 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' } ] }); 
+1
source

All Articles