Set maximize limits

8 posts, 2 answers
  1. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 14 May 2014 Link to this post

    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
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 14 May 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 14 May 2014 in reply to Dimo Link to this post

    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
  5. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 14 May 2014 in reply to Anthony Link to this post

    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
  6. Answer
    Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 14 May 2014 Link to this post

    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!
     
  7. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 15 May 2014 in reply to Dimo Link to this post

    Yep, thanks seems to work great now thanks
  8. Matjaž
    Matjaž avatar
    81 posts
    Member since:
    Jul 2015

    Posted 10 Aug in reply to Dimo Link to this post

    Is checking isMaximized option safe? TypeScript interface doesn't have isMaximized option.
  9. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 11 Aug Link to this post

    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.
Back to Top
Kendo UI is VS 2017 Ready