viewport.remove('initialcenter');
viewport.add('newpanel');
viewport.doLayout();
Some supplemental information. The newpanel's config has the region set as center as well (not sure if this is needed or not, but I couldn't figure out via the API docs where else I could set it). The interesting thing is that the original panel does get removed (you no longer see it) but the new panel never shows up. the .add call does return a reference to the panel being added, so I'm assuming that it's not an error.
Is this the right way to do it, or is it bad practice? The examples and API doc doesn't, surprisingly, show anything like this (maybe it does, if so, let me know.)
Thanks!
Taylor
Create an additional container panel with a layout of card in your center region. You can then add/remove panels as you please and use the layout's setActiveItem method. Check out the docs for CardLayout for further info.
#If you have any other info about this subject , Please add it free.# |