5

I have a BorderContainer {design: "sidebar"} with a AccordionContainer {region: "left"} in the left pane. The Splitter is enabled to allow dragging the AccordionContainer 'closed', but with the splitter still available at the left edge to drag it back 'open'.

How can I toggle it from the current width to 0px with code? - How do I get the current width? - How do I set the width and redraw if necessary?

I do not want to removeChild/Addchild as this removes the splitter.

[ Edit: Solution: http://jsfiddle.net/6aNrp/274/ ]

Thanks

Adamarla
  • 739
  • 9
  • 20

1 Answers1

2

I think You want dojo.marginBox.

undefined
  • 2,051
  • 3
  • 26
  • 47
  • While that does get and set the width - using 'AccordionContainer.domNode', I can't get the BorderContainer to resize the center pane to the available width - 'BorderContainer.resize()' does nothing. – Adamarla Jan 25 '12 at 12:35
  • I got it to work (http://jsfiddle.net/6aNrp/274/). Not sure what I was doing wrong before. Thanks – Adamarla Jan 25 '12 at 16:31
  • Just make sure to test it in different browsers. I know that in dojo 1.6 marginBox gives different results(dimesoins, including borders in IE and don't in FF or vice versa(can't remember)). – undefined Jan 25 '12 at 17:50