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

Set maximize limits

7 Answers 164 Views
Window
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 14 May 2014, 08:00 AM
Hi
  I see you can constrain the window such that it can't go beyond certain points.

http://www.telerik.com/forums/kendowindow-appendto-boundaries

This works for me. 

I would also like to constrain the window such that when you hit maximize it can't go above a certain point, how could I achieve this?

thanks

7 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 14 May 2014, 10:44 AM
Hello Anthony,

You can use the following approach to set the size and position of a Window when it is maximized. Please note that such a behavior is not officially supported and undesired side effects may occur.


function onResize(e) {
    if (e.sender.options.isMaximized) {
        e.sender.wrapper.css({top: 100, left: 100, width: 400, height: 300});
    }
}
 
$("#window").kendoWindow({
    resize: onResize
});

In case you don't know what e.sender or e.sender.wrapper is, please refer to:

http://docs.telerik.com/kendo-ui/getting-started/widgets#event-handler

http://docs.telerik.com/kendo-ui/getting-started/widgets#accessing-kendo-ui-widget-elements


Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anthony
Top achievements
Rank 1
answered on 14 May 2014, 02:21 PM
Thanks, that works.

Unfortunately I just noticed that when maximised the menu won't go over the top of the window, even when you use this:

@(Html.Kendo().Menu()
 .Name("Menu")
 .HtmlAttributes(new { style = "position: relative; z-index: 99999" })

I was hoping to have the window go no higher than the menu and the menu to always appear on top
0
Anthony
Top achievements
Rank 1
answered on 14 May 2014, 02:26 PM
I haven't done a jsbin before but hopefully this shows what I mean regarding the z-index

http://jsbin.com/uwujih/83/edit

Maximise the window and try using the Menu
0
Accepted
Dimo
Telerik team
answered on 14 May 2014, 04:01 PM
Hi Anthony,

A maximized Window has a position:fixed style applied, so it does not expand the HTML and BODY elements. In addition, page scrolling is disabled while the Window is maximized. This causes the Menu groups to be clipped when expanded. Please expand the page wrapper elements.

html,body
{
  height: 100%;
  margin0;
  padding0;
}


Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anthony
Top achievements
Rank 1
answered on 15 May 2014, 07:23 AM
Yep, thanks seems to work great now thanks
0
Seyfor
Top achievements
Rank 1
answered on 10 Aug 2016, 08:51 AM
Is checking isMaximized option safe? TypeScript interface doesn't have isMaximized option.
0
Dimo
Telerik team
answered on 11 Aug 2016, 03:18 PM
Hi Matjaž,

isMaximized is a Window option that cannot be set during initialization, but can be checked via JavaScript at any time after initialialization.

isMaximized may return true, false or undefined. undefined is the same as false and also indicates that the Window instance has not been maximized so far.

Regards,
Dimo
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
Window
Asked by
Anthony
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Anthony
Top achievements
Rank 1
Seyfor
Top achievements
Rank 1
Share this question
or