This question is locked. New answers and comments are not allowed.
Hello everyone,
I had a thread earlier regarding this issue - however it seems to have vanished. Anyways - as previously mentioned I am having an issue of another vanishing nature. I have a Telerik grid - with links on all of the "username" fields in a specific column - and upon clicking on one of this creates a Telerik Window (which contains a div called "WindowContent" which is used to populate the contents of the Window - depending on the username that it was passed.)
My issue is that the Window is created and works just fine - however upon closing the Window (using the "X" button in the Title bar) I seem to lose access to the window altogether. So if I was to click on another username - the Edit function would attempt to grab the window, but would only find a null.
I have stepped through the javascript several times using Firebug to determine what is happening with the Window, and by watching "$("Window").data("tWindow") I have determined that upon opening the Window the initial time (First click of a username) that the Windows becomes null - so even if I was to attempt to use Client-side events to handle the close method it still would be unable to access the Window.
I am attaching all the code that could relate to this - and any help to solve this issue would be greatly appreciated as I have been battling with it for several days now. (Thank you to nachid - for you help in the previous thread)
Master Page :
Edit Javascript Function :
Window :
Grid : (The Html.JavascriptLink simply creates a link that calls the Javascript function)
Syntax: ("Link Text", "Function Name", "Parameters[]")
Again - Thank you greatly for reading,
Rion
I had a thread earlier regarding this issue - however it seems to have vanished. Anyways - as previously mentioned I am having an issue of another vanishing nature. I have a Telerik grid - with links on all of the "username" fields in a specific column - and upon clicking on one of this creates a Telerik Window (which contains a div called "WindowContent" which is used to populate the contents of the Window - depending on the username that it was passed.)
My issue is that the Window is created and works just fine - however upon closing the Window (using the "X" button in the Title bar) I seem to lose access to the window altogether. So if I was to click on another username - the Edit function would attempt to grab the window, but would only find a null.
I have stepped through the javascript several times using Firebug to determine what is happening with the Window, and by watching "$("Window").data("tWindow") I have determined that upon opening the Window the initial time (First click of a username) that the Windows becomes null - so even if I was to attempt to use Client-side events to handle the close method it still would be unable to access the Window.
I am attaching all the code that could relate to this - and any help to solve this issue would be greatly appreciated as I have been battling with it for several days now. (Thank you to nachid - for you help in the previous thread)
Master Page :
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"><!-- Telerik Style Sheet Registrar --> <%= Html.Telerik().StyleSheetRegistrar() .DefaultGroup(group => group.Add("telerik.common.css") .Add("telerik.sitefinity.css")) %> <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title></head><body> <div> <asp:ContentPlaceHolder ID="MainContent" runat="server"> </asp:ContentPlaceHolder> </div> <%= Html.Telerik().ScriptRegistrar() %></body></html>Edit Javascript Function :
function Edit(username) { var window = $("Window").data("tWindow"); window.center(); $("#WindowContent").load("Test/Edit", { userName: username }); window.open(); }Window :
<% Html.Telerik().Window() .Name("Window") .Title("Edit User") .Visible(false) .Modal(true) .Content("<div id=\"WindowContent\" style=\"width: 485px; height: 380px;\"></div>") .Width(490) .Height(400) .Render(); %>Grid : (The Html.JavascriptLink simply creates a link that calls the Javascript function)
Syntax: ("Link Text", "Function Name", "Parameters[]")
<%= Html.Telerik().Grid<TestingModal.Models.User>() .Name("UserGrid") .Columns(columns => { columns.Bound(o => o.UserName).ClientTemplate(Html.JavascriptLink("<#=UserName#>", "Edit", "<#=UserName#>")).Title("Username").Width(100); columns.Bound(o => o.IsActive).Title("Active").ClientTemplate("<input type='checkbox' disabled='disabled' name='Active' <#= IsActive? \"checked='checked'\" : \"\" #> />").Width(40); }) .DataBinding(dataBinding => dataBinding .Ajax() .Select("_AjaxBinding", "Test") ) .Pageable() .Sortable()%>Again - Thank you greatly for reading,
Rion