PDA

View Full Version : basicdialog without buttons -- invalid body size & posit



vtswingkid
22 Feb 2007, 1:50 PM
I find that the body of the dialog is positioned and sized incorrectly when a button is not included in the dialog...

fire bug shows that the x-dlg-dlg-body has the following settings:
top: 10px I believe this is short 14px. (24px).
height: 14px too big.

vtswingkid
22 Feb 2007, 8:36 PM
So,

should i just try to override this with css?

Or is this a bug that will be fixed?

Or something all together different?

Please advise.

Thanks

jack.slocum
23 Feb 2007, 3:36 AM
You can provide a screenshot, a link or something to help figure out the problem?

vtswingkid
23 Feb 2007, 6:18 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<link rel='stylesheet' type='text/css' href='ext/resources/css/ext-all.css' />
<script type='text/javascript' src='ext/yui-utilities.js'></script>
<script type='text/javascript' src='ext/ext-all.js'></script>
<script type='text/javascript' src='ext/ext-bridge-yui.js'></script>
<script type='text/javascript'>
Test = function(){
var legend;
return{
Init:function(){
Ext.get(document.body).createChild({id:'test', tag:'div'})
legend = new Ext.BasicDialog('test', {
width: 250,
height: 170,
closable:true,
resizable:false,
draggable:true
});
legend.header.dom.innerHTML="Legend";
var str="<table><tbody>";
str+="<tr><td class='imgBoxFaded'></td><td> - Status Unknown</td></tr>";
str+="<tr><td class='imgBoxGray'></td><td> - Status Normal</td></tr>";
str+="<tr><td class='imgBoxRed'></td><td> - Error Status</td></tr>";
str+="<tr><td class='imgBoxBlue'></td><td> - Update Required</td></tr>";
str+="<tr><td class='imgBoxGreen'></td><td> - Reset Required</td></tr>";
str+="<tr><td class='imgBoxYellow'></td><td> - Rescan Required</td></tr>";
str+="</tbody></table>";
legend.body.dom.innerHTML=str;
legend.show(document.body.getElementsByTagName('div')[0]);
}
}
}();

Ext.onReady(Test.Init);
</script>
</body>
</html>

vtswingkid
23 Feb 2007, 7:23 AM
Ok, I put up a sight with the script above...

http://rwilliam.phpnet.us/test.html

jack.slocum
23 Feb 2007, 7:39 AM
You are overwriting the innerHTML and there is no way for the dialog to know that you have done it.

Here's one config options that will help:

syncHeightBeforeShow: true

This causes it to automatically recalculate dimensions before being shown.

Second:



closable:true,
resizable:false,
draggable:true
});
legend.header.dom.innerHTML="Legend";

Can be:


closable:true,
resizable:false,
draggable:true,
title: 'Legend'
});

This way it has a title on creation instead of empty (which causes the size to be off).