Hello Dimo,
thanks for your reply, which allowed me a leap forward.
Now I understand that to get events from the kendo window in the code-behind I must append the window to the form and
why initially the window is outside.
I added appendTo("form#myform") as configuration option in the creation of the window.The window has a button.
Now I have only one window and I get the button click event in the code-behind.
I have a further question though:
1.
Still I think I'm confusing jquery appendTo and kendowindow appendTo.
The kendowindow appendTo(form) is a configuration option when I create the window. If I create the window without this option,
in the javascript button handler I will call always the jquery appendTo(form) which will always duplicate the window correct ?
So My only option then is to appendTo(form) when I create the window, correct ?
2.
Now the close doesn't give any error but I have the following situation:
Javascript handler
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#dialogLogout").kendoWindow({
draggable: true,
height: "300px",
modal: true,
resizable: false,
width: "600px",
actions: ["Minimize", "Maximize", "Close"],
appendTo: "form#form1"
});
var wnd = $("#dialogLogout").data("kendoWindow");
$("#btnLogoutConfirmOK").bind("click", function () {
// window.parent.$("#dialogLogout").data("kendoWindow").close();
// $("#dialogLogout").closest(".k-window-content").data("kendoWindow").close();
$("#dialogLogout").data("kendoWindow").close();
});
});
</script>
The code behind is something like this (I added a sleep of 5 seconds to simulate a long operation).
protected void btnLogoutConfirmOK_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep((int)System.TimeSpan.FromSeconds(5).TotalMilliseconds);
}
The behavior seems
I click the button, the javascript handler is called,
The window closes, either of the 3 close statements give the same effect,
the server-side handler is called, waits for 5 seconds, it returns and forces the reopen of the window.
How can I close the window programmatically ?
Thank you for your kind attention,
best regards
Marco
thanks for your reply, which allowed me a leap forward.
Now I understand that to get events from the kendo window in the code-behind I must append the window to the form and
why initially the window is outside.
I added appendTo("form#myform") as configuration option in the creation of the window.The window has a button.
Now I have only one window and I get the button click event in the code-behind.
I have a further question though:
1.
Still I think I'm confusing jquery appendTo and kendowindow appendTo.
The kendowindow appendTo(form) is a configuration option when I create the window. If I create the window without this option,
in the javascript button handler I will call always the jquery appendTo(form) which will always duplicate the window correct ?
So My only option then is to appendTo(form) when I create the window, correct ?
2.
Now the close doesn't give any error but I have the following situation:
Javascript handler
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#dialogLogout").kendoWindow({
draggable: true,
height: "300px",
modal: true,
resizable: false,
width: "600px",
actions: ["Minimize", "Maximize", "Close"],
appendTo: "form#form1"
});
var wnd = $("#dialogLogout").data("kendoWindow");
$("#btnLogoutConfirmOK").bind("click", function () {
// window.parent.$("#dialogLogout").data("kendoWindow").close();
// $("#dialogLogout").closest(".k-window-content").data("kendoWindow").close();
$("#dialogLogout").data("kendoWindow").close();
});
});
</script>
The code behind is something like this (I added a sleep of 5 seconds to simulate a long operation).
protected void btnLogoutConfirmOK_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep((int)System.TimeSpan.FromSeconds(5).TotalMilliseconds);
}
The behavior seems
I click the button, the javascript handler is called,
The window closes, either of the 3 close statements give the same effect,
the server-side handler is called, waits for 5 seconds, it returns and forces the reopen of the window.
How can I close the window programmatically ?
Thank you for your kind attention,
best regards
Marco