PDA

View Full Version : How can I Exchange panel contents?



shafeek
10 Jan 2014, 1:09 AM
Hi all,

In my application there are two panels -A and B. I am using "border" layout, the panel A is in center region and panel B is in south region which have height 200. The "panel A" have lot of items like grid, toolbar etc. also "panel B" some items. My question is, How can I exchange the contents of A to B and B to A.

Note: I am using "Extjs 3.2"

Regards,
Mohammed Shafeek

slemmon
13 Jan 2014, 3:01 PM
The removeAll() method of a container returns an array of removed items (provided you pass the param of false to the removeAll() method). You could removeAll() on both the center and south panels and just store a reference to the items as they're removed and then use the opposite panel's add() method and pass the removed items as the param to add().

I don't recall if you'll need to manually do a layout() call on the panels after adding with 3.2 or not. The add() might get it all by itself - I'd start there.