views:

45

answers:

2

I have a dojo TabContainer that has a BorderContainer child, with a left region and a center region ContentPanes.

-TabContainer
    -BorderContainer
        -ContentPane (left)
        -dojox.layout.ContentPane (center)

I have it setup so that the left ContentPane is collapsible (by replacing it with a slimmer ContentPane) which works fine. However, the idea of this functionality is to make the center (dojox.layout.ContentPane) region wider but when the left pane is collapsed to the slim one, the center region stays the same width.

Now I know I can call refresh() on the center ContentPane but this also refreshes the content as the center ContentPane is retrieved via href - which I don't what as it loses changes to form data.

So how do I get the center ContentPane to refresh it's layout without manually figuring out the proper width and calling resize()?

A: 

how are you replacing the left pane? Are you using addChild/removeChild methods? How about just changing the widthof the left pane rather than replacing it?

peller
No, I just had a look at my markup and the left region contains a BorderConainer and a ContentPane. By default the ContentPane is hidden. The BorderContainer has a button that hides the BorderContainer and shows the ContentPane...the ContentPane contains a button the does the opposite. I have tried layout() on all layout containers in the tree and it doesn't resize after swapping the BorderContainer and ContentPane visibility.
Andrew Cobby
Do you want to toggle visibility of 2 widgets, a bordercontainer and a contentpane? If so, then the StackContainer is what you want. This will call resize on the child widgets, but for the content of the contentpane, you will have to manually resize.
Andy
A: 

Or could you use dojox.layout.ExpandoPane. It's a ContentPane that has a 'click to minimise' ability.

Andy
I may be able to achieve what I want with a modified version of dojox.layout.ExpandoPane... I'll try that out.
Andrew Cobby