Adjust window's size to dynamically loaded content

Hello everyone,

I’m currently creating a window whose content is dynamically loaded by using the attachURL function.

I’d like to resize this window to it’s content’s size … but I failed :frowning:

I’m using the OnContentLoaded event to enter in the callback and want to call the setDimension function.
Unfortunately, I don’t find how to retrieve the content’s size.

I looked on the documentation and found this example’s code :


… but the object returned by dhxWins.window() is an HTMLDivElement which doesn’t contains any “_frame” property.

Any idea ?

Thanks by advance …

After lots of research on the forum, I’ve found different solutions :

The first one is the “win.getView()._frame”
The second one is win.getFrame() (but not present in my current release of dhtmlx, required files are here)

Finally, I get the contentDocument.height and contentDocument.width properties from the returned object.

				dhxWins.attachEvent("OnContentLoaded", function(win) {
					var height = win.getView()._frame.contentDocument.height;
					var width = win.getView()._frame.contentDocument.width;

					win.setDimension(width, height);