Skip to content

Instantly share code, notes, and snippets.

@yesez
Created May 7, 2013 00:00
Show Gist options
  • Save yesez/5529277 to your computer and use it in GitHub Desktop.
Save yesez/5529277 to your computer and use it in GitHub Desktop.
@model IEnumerable<PartialView_Ajax.Models.VentasMes>
@{
ViewBag.Title = "Resumen";
}
<h2>Resumen Ventas</h2>
<table>
<tr>
<th>
@Html.DisplayNameFor(model => model.Mes)
</th>
<th>
@Html.DisplayNameFor(model => model.Valor)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Mes)
</td>
<td>
@Html.DisplayFor(modelItem => item.Valor)
</td>
<td>
@Ajax.ActionLink("Detalles", "ViewDetails", new { id = item.Id}, new AjaxOptions { UpdateTargetId="divDetails" }, new {@class = "linkDetail" })
</td>
</tr>
}
</table>
<div id="divDetails"></div>
<button id="btnOcultar">Ocultar</button>
@section scripts
{
<script>
$(document).ready(function () {
$('#btnOcultar').click(function () {
$('#divDetails').hide();
});
$('.linkDetail').click(function () {
$('#divDetails').show();
});
});
</script>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment