PDA

View Full Version : Noob problem - Ultra-wide Ext.Windows in IE7



kanthoney
4 Jun 2009, 2:26 AM
If I open the follwing HTML file in Firefox:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Ext.Window Test Page</title>
<meta http-equiv="Content-Script-Type" content="text/javascript"></meta>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"></link>
<script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript">
<!--
Ext.onReady( function()
{
var main_window = new Ext.Window({
title: 'Test',
items: {
xtype: 'form',
items: {
xtype: 'textfield',
fieldLabel: 'Text'
},
buttons: [{ text: 'Go' }]
}
});
main_window.show();
return;
});

-->
</script>
</head>
<body>
<div id="main">
</div>
</body>
</html>


I get a neat little dialog box in the middle of the screen. If I try the same in IE7, I get the right hand end of a very wide dialog box which I need to drag across to get to the business end. I've tried setting layout options (border layout, table layout, etc) without success. Setting the width manually is a work-around, but should I need to do that or am I doing something wrong?

4 Jun 2009, 5:33 AM
is there a reason you're not setting dimensions?

kanthoney
4 Jun 2009, 6:02 AM
It doesn't matter much for a simple example like this, but for complex (or dynamic) layouts the computer should be doing the work. More importantly, I want to know whether I'm doing something wrong.

4 Jun 2009, 6:07 AM
So you're saying that you want the window to automatically size to the children?

kanthoney
4 Jun 2009, 6:14 AM
Yes, please (that's what Firefox is doing). IE is rendering the window at more than 6,000 pixels wide!

4 Jun 2009, 6:15 AM
I never run into this issue because i always explicitly set dimensions for windows. My spider sense tells me that this is a bug with either IE7 or the framework. I would suggest posting in bugs.

aconran
4 Jun 2009, 6:19 AM
Ext.Window requires both a width and height configuration to work properly.

jesse.dhillon
23 Jun 2009, 1:58 PM
I can confirm that if you have this issue, it is because the width is not specified. I think the easiest way to figure out the width you want is to open your Ext.Window in Firefox and then use Firebug to get the width that it is set to.

I haven't tried it but maybe a call to Ext.Window.syncSize() would also work but why not just specify a width like you're supposed to? :)