Dhtmlxlayout does not resize when resizing browser window

Hi,

i currently have the problem that the layout-component does not automatically resize when the size of the browser window has changed…

my current cunstruction:

+--A1--------------------------------------+
| +--B1----------------------------------+ |
| |                                      | |
| +--------------------------------------+ |
| +--C1----------------------------------+ |
| |                                      | |
| |                                      | |
| |                                      | |
| +--------------------------------------+ |
+------------------------------------------+

A1 is a Table (width:100%; height:100%) with 2 rows and 1 column
row 1, cell 1 = width:100%; height:64px
B1 is a DIV (width:100%; height:100%)
row 2, cell 1 consumes the rest of the available height
C1 is a dhxlaxout (even a DIV width:100%; height:100%)

if i change the size of the window, the DIV of C1 resizes correctly,
but the inner div with the class “dhxcont_global_layout_area”, created

dhxLayout = new dhtmlXLayoutObject("parentId", "1C");

uses fixed pixel sizes and do not resize - shouldnt the layout resize to its attached div?

Hi,

try to call setSizes method after the window resize:

[code]
if (window.attachEvent)
window.attachEvent(“onresize”,resizeLayout);
else
window.addEventListener(“resize”,resizeLayout, false);

var t;
function resizeLayout(){
window.clearTimeout(t);
t = window.setTimeout(function(){
layout.setSizes(false);
},200);
}[/code]

Hi Alexandra -

I had a very similar issue, that essentially boiled down to the dhtmlxLayout not resizing with the parent window, and found your code snippet:

That works great, but only if you use true as the parameter to setSizes(), not false. At least, that is how it is now, in Pro version 2.6.

In addition, the current online documentation does not mention the true/false parameter for setSizes() at all. It shows the function as not receiving any parameters. It also appears that, if there are no parameters given, false is assumed: http://docs.dhtmlx.com/doku.php?id=dhtmlxlayout:api_method_dhtmlxlayoutobject_setsizes

But, thanks for the excellent solution!