how to show a row details in jquery modal dialog

Jul 15, 2014 at 8:45 PM
Edited Jul 16, 2014 at 12:10 AM
Hello Bukharin,

I am using Grid.Mvc. I have made one of my columns into an actionlink. I am using MVC 4. When a user click on the link how i can display that row in a jquery modal dialog? Basically I want to display the value of each column in that row in a jquery modal dialog. I dont want to edit or delete it just want to display the row.
Jul 17, 2014 at 11:13 AM
Refer this discussion

Instead of add or edit, follow the same procedure to show read only..
Jul 18, 2014 at 12:55 AM
Thanks for your reply. I have looked at that discussion before. It looked overwhelming the first time I looked at it. I will give it a try again and let you know how it goes.
Jul 18, 2014 at 9:03 PM
Edited Jul 18, 2014 at 9:04 PM
The pop shows up when I clink in one of the rows on a link column. Everything works fine when i click on a link first time the wepage shows up, the popup shows the correct details for the row. But when I click on another link in the grid, its suppose to show the details for that particular row but instead it shows me the details of that first linked I initially clicked on. So no matter which link I click i get the details of the link that i clicked first time. Why is it showing me the same record, no matter which link I click on the grid?

.RenderValueAs(x => Html.ActionLink(x.Location, "AppointmentDetails", "Home", new { scheduledDate = x.Date, location = x.Location, XFirstName = x.xFirstName, XLastName = x.xLastName }, new { @class = "modal-link" }));
Jul 21, 2014 at 2:08 PM
Edited Jul 21, 2014 at 2:09 PM
Found the solution here. Here is what you need to do if you run into the same problem. You will need to have the following code in your script tag.
<script> //this script reset modal each time when you click on the link: $(function () { $(".modal-link").click(function (event) { event.preventDefault(); $('body').on('', '.modal', function () { $(this).removeData('bs.modal'); }); $('#myModal').modal({ remote: $(this).attr("href") }); }); }); </script>