Window close does not close overlay if window is not displayed

4 posts, 1 answers
  1. Andre Beauchamp
    Andre Beauchamp avatar
    14 posts
    Member since:
    Jan 2004

    Posted 25 Apr Link to this post

    Hi, I have a problem where calling the close method on a window with it's parent container set to "display:none;" will not close the overlay nor fire the close event.
    I believe it should still close the overlay and fire the event even if it's not visible.

    I know the kendo window supports animations, but not with a callback at the end.

    You may take a look here: http://dojo.telerik.com/iwIVI/7

     

  2. Andre Beauchamp
    Andre Beauchamp avatar
    14 posts
    Member since:
    Jan 2004

    Posted 25 Apr in reply to Andre Beauchamp Link to this post

    This one here works better: http://dojo.telerik.com/iwIVI/13
  3. Kendo UI is VS 2017 Ready
  4. Andre Beauchamp
    Andre Beauchamp avatar
    14 posts
    Member since:
    Jan 2004

    Posted 25 Apr in reply to Andre Beauchamp Link to this post

    This one here works better : http://dojo.telerik.com/iwIVI/13
  5. Answer
    Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 27 Apr Link to this post

    Hello Andre,

    Indeed, the Kendo UI Window does not accept close() method calls if it is not visible on the screen.

    Closing the widget with custom DOM manipulation is not recommended. What I can suggest is to show the Window's parent outside of the viewport, execute the close() method, and then hide the parent.

    function Close(){
        var oWindow = $("#PopupWindow").data("kendoWindow");
      if(oWindow)
      {
        $("#PopupWindow").parent().addClass("customVisible");
          oWindow.close();
        $("#PopupWindow").parent().removeClass("customVisible")
      }
    }
    .customVisible {
       
      display: block !important;
      opacity: 0 !important;
      position: absolute !important;
      top: -3333px;
      left: -3333px;
    }


    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready