View Full Version : Toolbar not resized with panel.

5 Jan 2010, 1:44 AM

Has anyone come across this issue. I have a grid inside a panel. When i resize the panel the toolbar does not resize correctly in the grid and creates a scrollbar along the bottom. Similarly if i expand the panel size width ways the toolbvar stays fixed and is not anchored to the panel edge.

I am using ext 3.1 and this occurs in IE and FF

I will post a showcase if no one responds so please dont post a link on how to ask for help.



5 Jan 2010, 2:15 AM
You have to post code.

But I suspect an overnest in a no-layout Panel.

5 Jan 2010, 3:26 AM
Thanks animal

I'll re-double check but i think its fine. Will post code later.

But this is my layout structure

viewport > center region (container) (fit) > panel (anchor) > [formPanel, formPanel, grid]

5 Jan 2010, 3:54 AM
I assume that center Container will be loaded with various application components, and that's why you have a layout: 'fit' Container there. The anchor layout Panel is just the application component you happen to be dealing with now.

5 Jan 2010, 3:57 AM
Thats correct

if i set anchor: '100%' in each of items at the bottom of the tree everything overlaps the scrollbar if it exists but resizes correctly when i increase/decrease the size of the window.

If i remove anchor: '100%' then everything sizes correctly other than the toolbar inside the grid which remains at the size it was rendered when the page is first loaded no matter what i do.

Do I have to specify a value for the anchor property, and if so how do i stop it overlapping the scrollbar, i want to show scrollbar only when required????

5 Jan 2010, 5:13 AM
You need to use

anchor: '-' + Ext.getScrollBarWidth()

When the layout begins rendering the child items, it enquires how much space it has available.

Obviously at this time there are no scrollbars.

If at some point scrollbars appear, then these calculations will no longer be correct. But there's no way of then going back.

So you have to leave space.

5 Jan 2010, 5:19 AM
Wont this leave a gap for the scroll bar permenantly down the side of the page. If there are no scrollbars (the content fits on the page) then i want everything to stretch 100% across the screen with no gap. Is this possible with anchor layout or should i be using fit??

5 Jan 2010, 6:05 AM
Fit? You know what fit does don't you?

You don't know how high the three items will be, so you don't know whether there will be scrollbars or not. So leave a gap.

Either that, or perform an extra doLayout call after the first layout has been performed.

5 Jan 2010, 6:09 AM
doh, yes i realise fit is not an option. momentary lapse.

I'm leaving a gap for now as i dont have much more time.

Thanks for your help!