PDA

View Full Version : Tabpanel width



haltenberg
Jun 24, 2008, 1:56 PM
When I use a TabPanel without Width attribute specified or use AutoWidth="True"/"False" my TabPanel has crazy width (5000px). My page uses html tables for layout. Is it possible to make the TabPanel occupy just 100% of the containing cell and not break the layout with some weird width?

Thank you!

PS. The only workaround I found is:


<ext:Panel>
<Content>
<ext:BorderLayout>
<Center>
<ext:TabPanel>
<Tabs>
<ext:Tab>
<Content />
</ext:Tab>
</Tabs>
</ext:TabPanel>
</Center>
</ext:BorderLayout>
</Content>
</ext:Panel>

But this is kinda ugly: having to wrap TabPanel into a bunch of other containers just to get normal width. Any suggestions?

geoffrey.mcgill
Jun 24, 2008, 2:44 PM
Hi haltenberg,

The following forum post goes in depth into several work-arounds for this issue, see http://forums.ext.net/showthread.php?postid=746.aspx

I think for you're situation adding the simple css class to your TabPanel, as demonstrated in the post/attachment above, will fix the problem.

The best fix... try to avoid the use of <table>'s for structured layout. The only really weird issues I've run into involve the <ext:TabPanel>, but the post above should provide any necessary work-arounds.

Hope this helps.

haltenberg
Jun 24, 2008, 2:54 PM
Thank you Geoffrey! This explains a lot!

Unfortunately I'm adding a new functionality to an existing inhouse project, otherwise I wouldn't be using tables. Hopefully I would be able to find time and redo the whole damn thing from a scratch, but it's a beast :)

geoffrey.mcgill
Jun 24, 2008, 3:00 PM
Thanks for the update.

The Toolkit and ExtJS are so flexible that working around these issues is always possible, but it's just a matter of narrowing down the problem to find the root cause. ExtJS was never really designed to work in a old-school <table> layout, although in the end just adding one custom css style is a pretty painless fix.

Keep me updated and let us know if you run into any "issues".

haltenberg
Jun 24, 2008, 3:09 PM
Thanks Geoffrey!
The thing I would really like to have is ability to hook up server-side handlers to Window's hide event :) But as you have already told me, this is not currently possible.

geoffrey.mcgill
Jun 24, 2008, 3:20 PM
I'm working on a server-side Window close event solution. I'll keep you updated with the progress.