Hi,
I want that, when a user does double click on a grid's row, a new page is loaded with details of the row.
Index View<div class="row panel">
<div id="categories" class="col-xs-3">
@(Html.EJ().Grid<EntitiesInforme.SP.DetallesInformeSemanal>("FlatGrid")
.Locale("es-ES")
//.Datasource((IEnumerable<object>)ViewBag.DSInforme)
.SelectionType(SelectionType.Single)
.AllowPaging()
.AllowScrolling()
.Columns(col =>
{
col.Field("ID").HeaderText("ID").Visible(false).Add();
col.Field("NIS").HeaderText("NIS").Width(100).Add();
col.Field("FechaGeneracion").HeaderText("FechaGeneracion").Visible(false).Add();
})
.ClientSideEvents(eve =>
{
eve.RecordDoubleClick("onDoubleClick");
})
)
</div>
<script type="text/javascript">
onDoubleClick = function(args)
{
var source = Object.keys(args.data);
$.ajax({
url: "/Informes/InformeSemanal/Detalles",
type: "GET",
data: { 'id': args.data["ID"] },
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (data) {
if (data.RedirectUrl) {
window.location = data.RedirectUrl;
} else {
// replace the context of the section with the returned partial view
$('#upload_section').html(data);
}
}
}
Controller public ActionResult Detalles(int? id)
{
ViewBag.DSDetalles = db.GetDetallesInformeSemanal((int)id);
return View("Detalles");
}
The action "detalles" is working,
but does not redirect me to the page.
Thanks