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

Window close does not close overlay if window is not displayed

3 Answers 429 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andre Beauchamp
Top achievements
Rank 1
Andre Beauchamp asked on 25 Apr 2016, 04:53 PM

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

 

3 Answers, 1 is accepted

Sort by
0
Andre Beauchamp
Top achievements
Rank 1
answered on 25 Apr 2016, 05:06 PM
This one here works better: http://dojo.telerik.com/iwIVI/13
0
Andre Beauchamp
Top achievements
Rank 1
answered on 25 Apr 2016, 05:06 PM
This one here works better : http://dojo.telerik.com/iwIVI/13
0
Accepted
Dimo
Telerik team
answered on 27 Apr 2016, 12:59 PM
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!
Tags
Window
Asked by
Andre Beauchamp
Top achievements
Rank 1
Answers by
Andre Beauchamp
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or