PDA

View Full Version : Dynamically add buttons to a panel



ECU
11 Apr 2008, 1:09 AM
Dear community,

The following code doesn't work, I think it's due to lazy rendering. Does anyone has a workaround:



panelVar.add(
new Ext.Button({
text: 'Sample Button'
})
);

panelVar.doLayout();
panelVar.render();


Thank you.

aconran
11 Apr 2008, 7:07 AM
Do you want the buttons to appear within the body of the panel or within the footer?

Are you adding these buttons before you render the component for the first time or afterwards?

Take a look at the addButton method of Panel to add buttons to the footer of the panel before rendering.