PDA

View Full Version : close west, expand east



aracandrade
22 Feb 2009, 11:20 AM
Hi,

I have an application with a viewport with center, east, north and west regions. On initial application load, I create all of the regions, and make sure that east remain collapsed with the "collapsed" property.
The West region have a treepanel. When user clicks on a leaf, i want collapse west region and expand East region, and (if possible) vice-versa.
Can anyone point me how can i achieve this? Thanks in advance.

Animal
22 Feb 2009, 11:27 AM
http://extjs.com/deploy/dev/docs/?class=Ext.Panel&method=expand

http://extjs.com/deploy/dev/docs/?class=Ext.Panel&method=collapse

aracandrade
22 Feb 2009, 12:01 PM
Animal,

We, the learning people, fill honored when we can catch your attention, you are what we plan be in future. But this answer is a no-answer. Do you really think that people post questions without search until they can?
Asking for help comes with a lot of shame: How they know and i am stupid and donīt know?
I'm trying to do both methods at same time. I know how to use each one separatelly.
Thanks for your attention, ans sorry about my english.

aracandrade
22 Feb 2009, 1:02 PM
found by myself:



var w = Ext.getCmp('west-panel');
var e = Ext.getCmp('east-panel');
e.on('expand', function(){
w.collapse();
});
w.on('expand', function(){
e.collapse();
});
w.on('collapse', function(){
e.expand();
});
e.on('collapse', function(){
w.expand();
});

Animal
23 Feb 2009, 12:24 AM
Well done. So, the answer wasn't quite so much of a "non-answer" then was it?

It actually got you to look at your problem, read the docs, and find out what to do so you learned something from the process instead of being given code to copy/paste. Good result I'd say.

aracandrade
26 Feb 2009, 4:48 PM
You are correct. Sorry about my impatience.