I have the following table in my view.
<table>
<tr>
<th>Name</th>
<th>Start</th>
<th>End</th>
</tr>
<tr>
<td>Whatever</td>
<td>3/14/2012</td>
<td>3/31/2012</td>
</tr>
<tr>
<td>Whatever2</td>
<td>3/15/2012</td>
<td>3/30/2012</td>
</tr>
</table
What I want to be able to do in in my view is turn each col row for “Name” (Whatever, Whatever2) into a corresponding actionlink based on the corresponding id that is passed into the view (that will later provide drill down into another view). How can I do this using jquery?
Something like:
<script type="text/javascript">
@foreach(var row in Model)
{
<text>$('#rowcolid.text(@(Html.ActionLink(<name of the row cell for "Name" col>, "Details", new {id = modelItem => item.id})</text>
}
</script>
This is what I used for a solution in my view (it’s a hack but it achieved what I needed considering the constraints):