PDA

View Full Version : GetSplitBar Object after the region collapsed



hardy.lee
25 Sep 2008, 7:09 PM
Hello all, i got a problem when i get the SplitBar Object after the region was collapsed.

The attached Screen 1&2 are the Extjs example "layout/column".
On Screen 1 when the region "west" is appear, i can get the SplitBar by the following code:
var west_SplitBar = viewport.getLayout().west.getSplitBar();

Actally i want to hide/disable the Split function and collapse function after a user trigger some event on viewport. So i hide the SplitBar by this code:
viewport.getLayout().west.getSplitBar().el.hide();

It's work on the region "west" is appear, but when the region is collapsed, the code is not work to get the SplitBar object on the left handside(Please see the Screen 2, that is the object i want to get)

In fact i want to hide/show the SplitBar dynamically, it is possible? or it have a straightforward way to do it?

Thanks for the help.
Hardy

Screen 1
9642

Screen 2
9644

hardy.lee
26 Sep 2008, 3:39 AM
I try some others way to do hide/show the Splitbar dynamically,

I find if i hide the region "west" panel and collapse it, the Splitbar will hide too after collapse.
Ext.getCmp('west-panel").hide();
Ext.getCmp('west-panel").collapse();

But i got problem, if i try to collapse and expand the west-panel by click on the Splitbar before i call the hide and collapse function, the Splitbar expand button will still appear.( please see the screen 3)

Screen 3
9656

hardy.lee
28 Sep 2008, 5:38 AM
Could anyone tell me how to get splitbar object when the region was collpased, like(#1.Screen2).
I'm not looking for a code sample, but did any hints or reference about to get this splitbar object?

I try to get it by 'viewport.getLayout().west.getSplitBar();' , but it is no longer to west splitbar object.

thanks for the help >..<

mjlecomte
28 Sep 2008, 5:43 AM
Might give you ideas..http://extjs.com/forum/showthread.php?p=230415#post230415

hardy.lee
28 Sep 2008, 6:50 AM
Might give you ideas..http://extjs.com/forum/showthread.php?p=230415#post230415

Thanks!! mjlecomte.

It totally solve my problem! You are great~thanks!

mjlecomte
28 Sep 2008, 9:07 AM
Thank Condor in the other thread, he's the one that gave the solution. :)