PDA

View Full Version : replacing center region of borderlayout



hkatz
26 Nov 2007, 5:49 PM
Hi,

I am migrating to ext2.0 and am having a problem in replacing the center panel of my viewport.

What I'm trying to do is this:
My viewport uses a border layout. The north has a menu bar. When I click on a menu option, I want the center region of the layout to switch to the appropriate Panel. Functionally it's like having a TabPanel, though on top I have a menu instead. My Panels are dynamic and sometimes long to generate, thus I don't want to add them till needed.

The problem is I can't see how to replace the center region of the layout in ext 2.0 since the layout is created at configuration time. Am I missing something?

Thanks,
Howard

DigitalSkyline
26 Nov 2007, 6:51 PM
Most likely you'll probably want to use a tab panel, else a card layout for the center region, then you can add panel items to it and activate them. If you're only replacing content and not concerned about preserving the first screen you could just use update() on the center panel. All these methods are pretty well documented... though it does take a bit of time to get used to the new patterns.

santosh.rajan
26 Nov 2007, 10:00 PM
Another option is to add and remove the item as needed from your center panel.

hkatz
27 Nov 2007, 10:56 AM
I'd like to do that (add/remove), but don't see methods that would permit this.

santosh.rajan
27 Nov 2007, 9:13 PM
Give an id to the center panel and
Ext.getCmp("centerid").add(....).
Ext.getCmp("centerid").remove(....).

uttamthakor
28 Nov 2007, 4:48 AM
Hi
How Can I change container layout at runtime in ext2.0 ?.

Thanks
Uttam

santosh.rajan
28 Nov 2007, 6:32 AM
You cant change the layout dynamically. You can change the container.