Window - Not resizing with parent window

When a dhtmlx window is opened using document.body, the window object used to resize to completely fill the parent window when the parent is resized. This doesn’t seem to work in version 4.02. Note the behavior when running the full screen sample demo at:

dhtmlx.com/docs/products/dht … wport.html

Press the “open demo” button, set the window obect (not the parent window) to maximize so it fills the parent window and then pull the border of the resulting parent window to make it a little shorter or greater in height. In the past, the dhtmlx window would snap to fill the exact inner window area. Now it doesn’t and keeps it’s original dimensions. Looks pretty unprofessional. Is there a method to invoke that would enable this behavior? The docs seem to indicate it happens automatically now but the demo seems to prove otherwise. Is attachViewportTo needed, and if so, what is the syntax when using document.body?

Thx,
Mark

No comments…? Has anyone looked at the (lack of) resizing action described in the sample program… this can’t be the expected behavior…

Hi
Did you try it on 4.0.3 version? It was fixed there.

Darya:

Tested this with v 4.03 download and still -NOT- working.

Also tested with the sample program listed in first posting, same result (assuming those are running on v 4.03 now as well). The child window does -not-resize when the containing browser window is resized.

Please doublecheck and make sure this gets fixed. It seems very basic that the window objects should fit within their containing windows when used in full window mode. The current implementation just looks sloppy.

Provide us completed demo on support@dhtmlx.com (with link to this topic) - we will test it. If the is some unknown things - we will fix it.

Darya:

As noted in the first posting, we’re using -your- demo at:

dhtmlx.com/docs/products/dhtmlxW … _demo.html

Press the “open demo” button, set the window obect (not the parent window) to maximize so it fills the parent window and then pull the border of the resulting parent window to make it a little shorter or greater in height. In the past, the dhtmlx window would snap to fill the exact inner window area. Now it doesn’t and keeps it’s original dimensions. It seems like you’re not capturing the move events in the parent window. Looks pretty unprofessional. Is there a method to invoke that would enable this behavior? The docs seem to indicate it happens automatically now but the demo seems to prove otherwise. Is attachViewportTo needed, and if so, what is the syntax when using document.body?

Window will not resize. It is a standarв behaviour. You can use onresize event to resize dhtmlxWindow manually:

window.onresize = function(event) { w1.minimize(); w1.maximize(); };

Darya:

Yes, thanks that works. Could have sworn the windows used to do this internally, but since the code you suggested works it doesn’t much matter. Appreciate the help…

It is quite custom thing: users want to fix the window size in common, that is why there is no such native behaviour

Darya:

One suggestion that might help others: think about adding the code snippet you just posted into the full size window sample on your site. That way, users will see immediately how this is done if they want the dhtmlx window to resize with the parent…

dhtmlx.com/docs/products/dhtmlxW … _demo.html

[samples/02_viewports/inc/01_default_demo.html]

Thanks for idea, we will consider it.

I am using DHTMLX 5.0.2 and I don’t see onresize event on dhtmlXWindows.

i am opening it in very small IE
and then I resize my IE and i can see dhtmlXWindows uses all the space(see red border) but w1 does not


. I have to refresh IE webpage to get w1 maximized.

Is there any way i can get w1 maximized every time instead refresh?

Here is my code (this is straight from the sample report dhtmlx.com/docs/products/dhtmlx … wport.html
\5.0.2_Pro\samples\dhtmlxWindows/02_viewports/04_keep_window_in_viewport.html)

  • I just added red color border around dhtmlxWindows
  • changed width and height of w1 and called maximize function on it.
  • added onResizeFinish event and but it does not get fired when dhtmlxWindows resizes.
Keep window in viewport div#winVP { position: relative; height: 550px; border: 1px solid #dfdfdf; margin: 10px; } div#objId { position: relative; width: 100%; height: 100%; font-family: Roboto, Arial, Helvetica; font-size: 14px; color: #404040; overflow: auto; }
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

I tried below but it did not work either:

var dhxWins, w1;
function doOnLoad() {
dhxWins = new dhtmlXWindows();
dhxWins.attachViewportTo(“winVP”);
dhxWins.vp.style.border = “red 1px solid”;
w1 = dhxWins.createWindow(“w1”, 0, 0, 1000, 500);
w1.button(“close”).disable();
w1.keepInViewport(true);
w1.maximize();
w1.attachObject(“objId”);
window.addEventListener(“resize”, function () {
window.setTimeout(function () {
w1.maximize();
}, 500);
});
}

I found a work around which is

I have to call minimize or set different size before i call maximize.

		window.addEventListener("resize", function () {
				        window.setTimeout(function () {
					    w1.minimize();
				            w1.maximize();
				        }, 100);
				    });