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

[Solved] Pop Up window from Gird Column

3 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tarun
Top achievements
Rank 1
Tarun asked on 18 May 2011, 04:18 PM
Hi,
I am using Telerik MVC Grid with Ajax Binding. I want a functionality in which when i click on a Grid Column with hyperlink it should open a new Modal Popup window. I also want to pass Id of that column to that window. I tried with Popup window demo provided. I am getting the normal popup window but when i try to populate content of that window through Jquery get method it is giving me error. I have tried the following link also but it is not working for me.
http://www.telerik.com/community/forums/aspnet-mvc/grid/grid-custom-popup-model-window.aspx
Below is the code i am using:
 In my column:
 columns.Bound(o => o.Title)
          .Width(100)       
          .Title("")       
          .ClientTemplate(@"<a  href='#' onclick='Details()'  ><#= Title #></a>")
In jquery:
            function TaskDetails() {
            var url = '@Url.Action("Action""Controller")';
  $.get(url , function(data) {
    var modalwindow = $('#Window').data('tWindow').
            modalwindow.content(data); 
            modalwindow.center().open(); 
                     }); 
}
This is my modal window:
@{  
          Html.Telerik().Window()    
              .Name("Window")       
              .Title("Details")      
       
      .Width(500)     
      .Draggable(true)    
      .Modal(true)  
      .Visible(false)  
      .Render();} 

Please help.













thanks
Tarun

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 19 May 2011, 10:02 AM
Hi Tarun,

 I suspect that the error you are getting is due to the use of a variable which does not exists. Please modified the code as follows:

var modalwindow = $('#Window').data('tWindow').
            .content(data).center().open();


Best wishes,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tarun
Top achievements
Rank 1
answered on 22 May 2011, 02:31 PM
hi,
now i am getting the popup window. but it loads only for the first time. when i close the popup window and tries to open again it gives me error at below line:
.data('tWindow') saying it is undefined.
any idea why this is happening?
thanks
tarun
0
Hristo Germanov
Telerik team
answered on 23 May 2011, 10:46 AM
Hello Tarun,

Unfortunately I am not able to reproduce this issue locally. Could you please send us a simple test project which reproduces the depicted issue? Thus I will be able to observe the problem and advice you further.

All the best,
Hristo Germanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Tarun
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Tarun
Top achievements
Rank 1
Hristo Germanov
Telerik team
Share this question
or