Detecting minimize and un-minimize

2 posts, 0 answers
  1. Michael
    Michael avatar
    6 posts
    Member since:
    Dec 2012

    Posted 12 May Link to this post

    I'm trying to get the Kendo window to behave like Windows - dive down to the bottom of the browser on minimize and restore in some visible position on restore. The first part isn't a problem - I trap the Minimize event, calculate the viewport dimensions and the window dimensions, and do a jQuery animate to move the now-minimized window where I want it.

    The problem comes in when it restores. As we can see on http://demos.telerik.com/kendo-ui/window/events when we edit the code to handle minimize, only the first time the window is restored is there any event at all -- subsequent minimizes do pop a minimize event, but the second and further un-minimizes throw no event whatsoever.

    I took a look at the approach given on http://www.telerik.com/forums/store-window-minimize-state where we can trap the click to the minimize button, and that looked promising. The drawback there is that we do it on mousedown for the button, and I can't figure out how to get the kendoWindow data() in a generic way from the mousedown event handler. I can find the DOM element, but it doesn't have any relation to the DIV where I hooked the kendoWindow. I figure that I need that widget in order to do the minimize() call so that I can then move the minimized (or un-minimized) window if I so desire.

    Hope this makes sense. Any thoughts as to where I shoujld go from here?

    Thanks.

    -- Michael

     

  2. Dimo
    Admin
    Dimo avatar
    8332 posts

    Posted 16 May Link to this post

    Hi Michael,

    Please do the following to obtain the Window widget object:

    - from the minimize button, traverse up to the .k-window element
    - find the .k-window-content child of the .k-window element. This is the <div> to which the widget object is attached to.

    http://docs.telerik.com/kendo-ui/controls/layout/window/overview#html-structure-and-dom-placement

    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
Back to Top