PDA

View Full Version : Adding widgets after render



danikenan
30 Jun 2008, 12:43 PM
Hi,

I need to dynamically change the widgets on a panel in an interactive manner.
For example, I have two rows of buttons. The button clicked on the top determines which
buttons are displayed on the bottom row.
Assuming I cannot preload all the possible buttons and simply apply a show/hide on them,
how can I remove and add buttons dynamically after the panel and the initial buttons are rendered.

I call add on the panel, but the Componet.add of the Panel simply adds the new buttons to the items collection and does not take care of displaying them.

BTW the panel is rendered using a renderTo in the config param.

10x

devnull
30 Jun 2008, 1:47 PM
You dont show any code, but the behavior you describe is consistent with failing to call doLayout() on the container after calling add() or remove().

danikenan
1 Jul 2008, 12:14 AM
Thanks.

evant
1 Jul 2008, 12:24 AM
More info here:

http://extjs.com/learn/LayoutFAQ