Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ExtJS 4
如何像在按钮属性中一样(动态地)将按钮添加到面板?在 ExtJS 3 中,我们有panel.addButton()但在 ExtJS 4 中没有找到任何这样的功能。我也尝试panel.addDocked()过,但没有成功。
panel.addButton()
panel.addDocked()
Ext.onReady(function() { var p = Ext.create('Ext.panel.Panel', { width: 200, height: 200, renderTo: document.body, title: 'A Panel', buttons: [{ text: 'B1' }] }); setTimeout(function(){ p.down('toolbar').add({ text: 'B2' }); }, 1000); });