View Full Version : Using the same panel for all tabs in a TabPanel

4 Jun 2009, 4:25 PM
I am new to ext-js framework and am wondering whether it's possible to use the same Panel for all tabs in a TabPanel. I want to create a tab panel with 4 tabs, setting the html property of the first tab. From then on, I want the same content to show up when a different tab is activated. What's the best way to accomplish this?

The reason I want to do this is that each of my tab panel contains a flash component and I don't want to create a flash component for each tab. I would rather have one and update the flash component when a different tab is selected. I already have the logic in place to update the flash component on demand. I am now grappling with the problem of porting the tab content when a different tab is clicked.

4 Jun 2009, 4:31 PM
You could "nest" your panel with the flash inside the tab panels, and in the tabpanel.beforetabchange event, use the remove/add methods to "move" it among tabs.

4 Jun 2009, 4:32 PM
btw, the remove method has an argument to prevent destroying.

4 Jun 2009, 10:02 PM
Got it! I will try it out.