This is a migrated thread and some comments may be shown as answers.

[Solved] Window resize limited after browser resize.

3 Answers 376 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 21 Oct 2018, 01:00 AM

Hi,

When I add a window with a draggable containment that changes with browser resizing the kendo window is limited to the containment elements original browser size.

1. run the example with a small browser window.

2. resize the browser to make it bigger.

3. try to resize the kendo window to make it bigger, it will not get bigger than the original containment size.

https://dojo.telerik.com/axuRUkiq/3

Is there an initialization function that I can call to reset the containment? I can kind of fix it by setting the maxHeight, maxWidth options on the window resize.

Thanks.

Martin
Top achievements
Rank 1
commented on 09 Apr 2026, 03:07 PM

I've hit this issue as well - 7 years later and its still not fixed!

Centering and resizing of a contained window only takes account of the initial size of the container, not its current size. This can lead to the window's maxHeight and maxWidth being set to wildly wrong values - zero in my case - making the windo open and center into completely the wrong place.

I've found that adding a window.setOptions( {maxHeight:Inifinity, maxWidth:Infinity}) before doing an window.open() and/or window.center() makes it work correctly, as it forces a re-evaluation of the containment's current dimensions.

Nikolay
Telerik team
commented on 13 Apr 2026, 12:30 PM

Hi Martin,

The Kendo UI Window component currently does not provide a dedicated initialization function to reset containment constraints or force a re-evaluation of the container size after the initial setup. The behavior you observed—where maxHeight and maxWidth are calculated only during initialization—can indeed cause issues if the container size changes dynamically.

Your approach of calling:
window.setOptions({ maxHeight: Infinity, maxWidth: Infinity });
before invoking window.open() or window.center() is the most effective workaround available at the moment. This method forces the Window to recalculate its constraints based on the container’s current size.

If you need the Window to stay responsive to container or browser resizing, you can enhance your solution by binding to the resize event:
$(window).resize(function() {
    var wnd = $("#window").data("kendoWindow");
    wnd.setOptions({ maxHeight: Infinity, maxWidth: Infinity });
    wnd.center();
});
This ensures the Window always adapts to the latest container size.

Currently, there are no alternative built-in methods to reset containment constraints dynamically, so your workaround is the recommended approach given the widget’s limitations.

If you have further questions or need more guidance on handling specific scenarios, please let me know.

3 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 23 Oct 2018, 03:12 PM
Hello Andrew,

Currently changing the Window's draggable configuration after initialization, is not taken into account (even if the setOptions method is used), so we can suggest destroying and re-initializing the widget on window.resize. Here's a modified version of the dojo example you posted.

Regards,
Ivan Danchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andrew
Top achievements
Rank 1
answered on 26 Oct 2018, 06:14 PM
Thanks.
0
Ivan Danchev
Telerik team
answered on 30 Oct 2018, 09:37 AM
Hello Andrew,

Please have in mind that the setOptions method, which the widgets inherit from the base class, is implemented per widget and some widget options cannot be set with this method.

Regards,
Ivan Danchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Window
Asked by
Andrew
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or