Resize existing window to fit new content

When creating a window and attaching an object it is possible to specify a second parameter that sizes the window to fit the object. However there are times when I need to change the content and/or size of the

that has already been attached and would like to get the window to re-size to fit these changes. I don’t see any public method to do this and using setDimension requires that I know the new size. Is there any way to do this?

Hello,

Please try to add second param “true” into attachObject, but make sure your

have width and height specified:

var w1 = dhxWins.createWindow(“w1”,1,1,320,200);
w1.attachObject(“myObj”, true);

I am already doing that when creating the window.

The content of the window is dynamic and I want to be able to resize the window to fit after the content changes. Something like “layout.setSizes()”.

Try

dhxWins.window(“w1”)._adjustToContent(w,h);

w - content width, h - height.