-
6 Mar 2009 10:51 AM #1
[2.2] IE BorderLayout: Nested west panel width set to 0 inside collapsed south panel
[2.2] IE BorderLayout: Nested west panel width set to 0 inside collapsed south panel
I did a search but could not find a case exactly like this:
When the south panel is expanded (using the mini expander on the split bar), you will see that the nested west panel's width is 0 (instead of 180).Code:function go() { var p = new Ext.Panel({ renderTo: "here", width: 700, height: 500, layout: "border", items: [ { region: "center", html: "This is the main panel" }, { region: "south", layout: "border", region: "south", split: true, collapsible: true, collapseMode: "mini", collapsed: true, height: 234, items: [ { region: "west", split: true, hideMode: "offsets", width: 180, html: "this is lower left pane." }, { region: "center", html: "this is lower main pane." } ] } ] }); } Ext.onReady(go);
If you set the collapsed property to false on the south panel. It works as expected.
I tried the usual workaround of setting hideMode to "offsets" or "visibility" (as mentioned in other threads related to tab panels). But none of the combinations I tried worked.
Thanks in advance...
-
6 Mar 2009 11:24 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
Did you add hideMode:'offsets' to the south panel?
-
6 Mar 2009 11:28 AM #3
Yes... and I tried it again just to be sure.
Unfortunately, it didn't solve this problem.
Thanks, though...
-
7 Mar 2009 12:32 AM #4
A perfect example of why you should indent with spaces.
But anyway, pasting this code into the console in one of the example pages:
When I expanded that collapsed south produced:Code:Ext.getBody().update(''); var p = new Ext.Panel({ title: 'Test', renderTo: document.body, width: 700, height: 500, layout: "border", items: [{ region: "center", html: "This is the main panel" }, { region: "south", layout: "border", region: "south", split: true, collapsible: true, collapseMode: "mini", collapsed: true, height: 234, items: [{ region: "west", split: true, hideMode: "offsets", width: 180, html: "this is lower left pane." }, { region: "center", html: "this is lower main pane." }] }] });

What is 'here' in you page?Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
7 Mar 2009 12:48 AM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
@Animal: IE6/7 doesn't have a console, so how did you manage to paste your code there?
@reycri: Yes, hideMode doesn't work here...
-
7 Mar 2009 4:46 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
Let's solve this Ext 6/7 collapsed borderlayout sizing problem once and for all:
Code:Ext.override(Ext.layout.BorderLayout.Region, { getSize : function(){ return this.isCollapsed ? this.getCollapsedEl().getSize() : (Ext.isIE ? this.panel.getPositionEl().getStyleSize() : this.panel.getSize()); } });
-
7 Mar 2009 8:20 AM #7
@Animal: Sorry for the excessive indents, my editor uses only 4 spaces per tab. 'here' is the id of an empty div element in my sample page. This problem only occurs in IE - I tried IE6 and IE7.
@Condor: The override you provided didn't work. Immediately after the page renders (while the lower pane is still collapsed), I inspected the lower left pane and its offsetWidth property is 0. It's styles.width is "0px". I used the "IE Developer Toolbar" to inspect this.
-
7 Mar 2009 8:50 AM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
OK, now try this solution:
Code:Ext.override(Ext.Container, { doLayout : function(shallow){ if(!this.isVisible() || this.collapsed){ this.deferLayout = this.deferLayout || !shallow; return; } if(this.rendered && this.layout){ this.layout.layout(); } if(shallow !== false && this.items){ var cs = this.items.items; for(var i = 0, len = cs.length; i < len; i++) { var c = cs[i]; if(c.doLayout){ c.doLayout(); } } } }, onShow : function(){ Ext.Container.superclass.onShow.apply(this, arguments); if(c.deferLayout !== undefined){ var deep = this.deferLayout; delete this.deferLayout; c.doLayout(!deep); } } }); Ext.override(Ext.Panel, { afterExpand : function(){ this.collapsed = false; this.afterEffect(); if(c.deferLayout !== undefined){ var deep = this.deferLayout; delete this.deferLayout; c.doLayout(!deep); } this.fireEvent('expand', this); } });
-
7 Mar 2009 11:51 AM #9
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
7 Mar 2009 12:02 PM #10
Thanks, Condor, that worked perfectly.
So this fix is obviously not in v2.2.1...
Will this fix be in v3.x?


Reply With Quote