PDA

View Full Version : [2.0] Border Layout? - How to collapse 'west', 'north' & 'south' with one click?



fpurcell
22 Nov 2007, 1:18 PM
I have a typical border layout (taken from the example http://extjs.com/deploy/dev/examples/layout/complex.html) , and I want to provide a 'full-screen' button that collapses the 'west', 'north' & 'south' panels with one click. Thus, I'm looking to programmaticly toggle the slide in/out features on various panels of the border layout.

Here's a list of the various calls that I've been spinning my wheels on so far, with no success:
//m_west.slideIn("t");
//m_south.el.slideOut('b', {durration: 1});
//m_south.shadow.el.slideOut("b");
//m_west.el.slideOut("l");
//m_layout.getRegion('west').slideOut();
/*
m_west.el.slideOut('l', {
afterStyle: {left: '0px', right: '0px;'} // Fixes mis-alignment from scrollbar
});
*/
//m_west.el.setWidth(5);
//m_west.doLayout();
//m_west.hide();
//m_south.hide();

I'd much appreciate it if someone could explain how to toggle the various regions.

Thanks
-Frank

tryanDLS
22 Nov 2007, 2:45 PM
I think you want to use expand/collapse instead of show/hide.

fpurcell
22 Nov 2007, 10:03 PM
Thanks Tim!

m_west.collapse() / m_west.expand()
m_south.collapse() / m_south.expand()
m_north.collapse() / m_north.expand()

are the functions I was looking for. Cheers.