-
22 Aug 2010 5:43 PM #1
Ext.Window without explicit width display issues in IE / chrome
Ext.Window without explicit width display issues in IE / chrome
Hello,
I've tried searching for the answer to this problem but couldn't find anything, so maybe my search criteria was just off.
The problem is that a simple Ext.Window without an explicit width renders the entire width of the page in IE with a goofy looking shadow, and sometimes chrome. I don't want to set a width directly on the window because I need to set the exact width of the window's body element... setting it on the window directly causes ~10px or so to be clipped because of the window's sides. The documentation says that the default width of the window is the browsers auto, so I'm not sure if I'm just missing a config option or what the deal is.
This problem can be seen with this simple example:
thoughts/suggestions?Code:Ext.onReady(function() { new Ext.Window({ title: "dummy window", html: "i am a window" }).show(); });
-
22 Aug 2010 10:11 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
Consider what the normal default width of an element in a browser would be. Would it be the width of the text? No, a display:block element would stretch to the right of the containing element (which for a window, which is initially rendered with position:absolute;left:-10000px, would be very wide!).
MessageBox solves this by rendering the window initially with a fixed max. width and then calculate the required width (adding getFrameWidth('lr') of the containing elements).
-
23 Aug 2010 4:17 AM #3
Doh, thanks! That makes sense, I barely read the first few words of your first sentence and it kind of dawned on me. So now my question is this:
Say I have a window with a body element that is sized to 500px wide. To properly set the width of the window, should I use the line below?
Thanks again!Code:this.setWidth(500 + this.getFrameWidth());
-
23 Aug 2010 4:29 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
(and mabye also + this.body.getFrameWidth('lr') - depending on what the body holds)Code:this.setWidth(500 + this.getFrameWidth('lr'));
Similar Threads
-
Chrome Issues
By Jangla in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 12 Aug 2010, 3:04 PM -
Google Chrome UI Issues (v 2.2)
By yenduttjain in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 10 Sep 2009, 1:00 AM -
Omitting width for Ext.Window in IE7 causes display problems (ext 3.0)
By jacurry in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 20 Jul 2009, 7:13 AM -
What is the status of replacing the system chrome with Ext window?
By murrah in forum Ext.air for Adobe AIRReplies: 22Last Post: 3 Jun 2009, 6:01 PM


Reply With Quote