destroy window on close

2 Answers 2361 Views
Window
Henk Jelt
Top achievements
Rank 1
Henk Jelt asked on 20 Jun 2012, 08:30 AM
Hi

I create a window, which I would like to destroy after closing, but I cannot get it to work.

I have found various hints in the forum, but if I implement them, the window keeps coming back after refreshing the screen (ie performing a feedback).

The code which I use to initialize the window is pretty standard:
		<script type="text/javascript">
	 $(document).ready(function () {
		$('#windows').css('z-index', 9000);
		$("#Payment").kendoWindow({
			actions: [ "Maximize""Minimize""Close"],
			draggable: true,
			height: "600px",
			modal: false,
			resizable: true,
			title: "<%=ViewData("paymentenginetext")%><%=  ViewData("invoicenr")%>",
			width: "810px"
		}); 
		var kendoWindow = $("#Payment").data("kendoWindow");
        kendoWindow.center();
	});
	</script>

The way to destroy the window is to perform the function destroy at deactivation, but where and how do I put this in my code?

KR

Henk Jelt Hoving 

2 Answers, 1 is accepted

Sort by
0
Mickie
Top achievements
Rank 1
answered on 27 Jun 2012, 06:45 PM
Hi Henk,

I recently needed to implement a destroy after closing and put this together to play around with it (fyi there is some issue w/ this fiddle in IE but it works ok in Chrome and FF), maybe this will help you(?):  http://jsfiddle.net/mastamm/Wp82P/27/ 

I'm seeing in the forums and documentation a recommendation that you do not need to destroy a window, particularly if you are going to use it again.  But in my case I needed to because we had implemented an edit form in a kendo window and found that if you opened the window, made some changes then closed the window without saving, the next time you opened the window - prior to the content being refreshed, you initially saw those last changes that you didn't save.  So, we wanted a way to be able to remove the window and its contents from the DOM and then later recreate it on click of an edit button.  (additional note: even though there is some issue w/ that fiddle in IE the technique works just fine in our app in all browsers)

    - Mickie
Cary Abramoff
Top achievements
Rank 1
commented on 28 May 2013, 08:22 AM

You just helped me make quick work of this issue with a simple copy & paste from your fiddle. Muchas Gracias.
Mickie
Top achievements
Rank 1
commented on 05 Jun 2013, 04:25 PM

Great - glad that was helpful to you!
Tareq
Top achievements
Rank 1
commented on 11 Jul 2013, 01:56 AM

Thanks Cary! that was very helpful. :)
Bryan
Top achievements
Rank 1
commented on 07 Nov 2013, 03:28 PM

Thanks Mickie, this was driving me crazy, too.   Creating a new element for the window as a container was the fix for me:

$("#windowcontainer").append("<div id='window'></div>");
0
Doug
Top achievements
Rank 1
Veteran
answered on 26 Jan 2020, 06:26 PM

Another option that might work for you is to simply clear the content of the window when you are done with it.

$("#nameOfWindow").data("kendoWindow").content("");
Alejandro
Top achievements
Rank 1
commented on 18 Jun 2020, 07:59 PM

Your code helped solve a similar issue I had. Thanks so much!
Hammy
Top achievements
Rank 1
Veteran
commented on 24 Jun 2020, 11:04 AM

Hi There, 

In my vue component I have a list where user can click and view more details in a kendo window component. The user can open multiple non-modal draggable windows without blocking/dimming the main page.

 

The minimize only collapses' the window body which is not great use of screen space with just seeing the collapsed window tile bars stacking up.

 

Is there a way, we can move / dock the minimize kendo window to the corners of the screen and restore them when un-minimize?

 

 

 

It would be great if the window component can supports docking. For example https://github.com/ROMB/jquery-dialogextend 

Many thanks

Hammy Babar

 

Ivan Danchev
Telerik team
commented on 29 Jun 2020, 09:07 AM

Hello Hammy,

Currently, the Window does not have such docking capabilities, but this is a valid suggestion, so you could log it as a feature request in our Feedback Portal: https://feedback.telerik.com/kendo-jquery-ui/

We will consider implementing it, based on the interest the community shows in it.

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Window
Asked by
Henk Jelt
Top achievements
Rank 1
Answers by
Mickie
Top achievements
Rank 1
Doug
Top achievements
Rank 1
Veteran
Share this question
or