PDA

View Full Version : [2.0b1][SOLVED] Bug with interaction between collapse and hide



NBRed5
12 Oct 2007, 1:39 AM
Ext 2.0-beta1
ext-base.js
Windows XP Professional Service Pack 2
browser any

I have a viewport with a west region that is collapsible, I also have a toolbar with a button that hides/shows the panel in the west region (and subsequently the west region as this is the only panel in the region).

Hiding/showing the west region works fine if the west region has never been collapsed. If however at any point the region has been collapsed then the IsVisible method of the panel always returns true after the panel has been hidden therefore once the panel has been hidden the following code always tries to hide the panel as IsVisible returns true.


this.stree.isVisible()?this.stree.hide():this.stree.show();

I have debugged as far as I can and as far as I can tell the issue is that collapse/expand and hide/show use different methods to hide or show the panel, hide/show use a class and collapse/expand use style attributes.

The panel IsVisible method checks for the style attrubutes and not the application of the class that has hidden the panel.

Therefore once the style attributes have been applied by collapse/expand they seem to overide the class x-hidden-display and IsVisible is returning true as the visiblity and display options are such that the panle should be visible, however as the x-hidden-class has been applied it is not.

I hope I have expalined it well enough, basically hide/show and IsVisible work fine if the panel has never been collapsed/expanded, however once it has been collapsed/expanded, and then hidden, then IsVisible returns true when in fact the panel is hidden.

Nick

jack.slocum
12 Oct 2007, 10:12 AM
isVisible checks if that Panel has been hidden. It cannot determine whether or not it is visible on the screen.

If you are collapsing a parent container, then you will need to check the collapsed or hidden property of that Panel, not the child one.

NBRed5
12 Oct 2007, 2:57 PM
The panel in question does not have a parent panel, it is added directly to a viewport's west region.

To see the problem in action visit www.ext.nbred5.com (http://www.ext.nbred5.com) and use the first toolbar button to hide/show the treepanel in the west region, which will work until at any time you collapse and expand the west region and then hide the treepanel again, then try and show it again and it will not show because calling IsVisible on the tree panel will now return true even though the tree panel is hidden.

My problem is that the behaviour of hiding/showing the treepanel works fine if the west region is never collapsed and expanded, however once it has been collapsed and expanded then it does not.

Nick

jsakalos
14 Oct 2007, 3:53 PM
We will investigate this further and we will let you know the result.

jack.slocum
14 Oct 2007, 10:02 PM
This should be fixed in SVN. Thanks.