View Full Version : LayoutDialog regression?

11 Apr 2007, 11:30 AM
I have a LayoutDialog with a nested layout panel that worked in alpha3 and does not work in beta1 or beta2. In the betas the north and south panels are not displayed. Here's the code (remove either the includes of alpha3 or beta2 to see it work or not work). (I'm running on FF.)


<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />

<script src="ext-1.0-alpha3/yui-utilities.js"></script>
<script src="ext-1.0-alpha3/ext-yui-adapter.js"></script>
<script src="ext-1.0-alpha3/ext-all.js"></script>

<script src="ext-1.0-beta2/adapter/yui/yui-utilities.js"></script>
<script src="ext-1.0-beta2/adapter/yui/ext-yui-adapter.js"></script>
<script src="ext-1.0-beta2/ext-all.js"></script>

<script type='text/javascript'>

function winMain()
var dlg = new Ext.LayoutDialog(
'ew-dlg', {height:450, width:730, north:{}, south:{}, center:{}});
dlg.addButton("OK", function() {alert('ok')});

var layout = dlg.getLayout();
var innerLayout = new Ext.BorderLayout(
'ew-center', { west: {split:true, initialSize:'50%'}, center: {} });
layout.add('north', new Ext.ContentPanel('ew-north'));
layout.add('south', new Ext.ContentPanel('ew-south'));
innerLayout.add('west', new Ext.ContentPanel('ew-center-west'));
innerLayout.add('center', new Ext.ContentPanel('ew-center-center'));
layout.add('center', new Ext.NestedLayoutPanel(innerLayout));



<div id='ew-dlg' style='visibility:hidden'>
<div class='x-dlg-hd'>LayoutDialog</div>

<div class='x-dlg-bd'>
<div id='ew-north'><button>Button</button></div>
<div id='ew-center'></div>
<div id='ew-center-center'></div>
<div id='ew-center-west'></div>
<div id='ew-south'><button>Button</button></div>

<div class='x-dlg-ft'></div>


11 Apr 2007, 12:08 PM
You need to specify initialSize on your North and South regions.

11 Apr 2007, 12:28 PM
Prior to 1.0-beta1, Ext figured out how big to make the regions automatically.
Was this feature unintended?
Are you certain that now we need to figure this out manually?
Seems like a step backward.
Am I missing something?

11 Apr 2007, 1:13 PM
I'm not sure what was going on before. I do remember that there were some issues around null values and problems with calculating how far the splitters could be allowed to drag the borders and size calculations. Since there's really no way to guess what the defaults should be if you don't specify anything, they may be treated as 0 now to avoid problems.