[AcceptVerbs(HttpVerbs.Post)] public ActionResult ChildGrid(PagingParams args, int? capacitacion_id) { var data = capacitacion.getListadoParticipantes(capacitacion_id); return data.GridActions<GetCapacitacionParticipantesResult>(); } |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Syncfusion.Mvc.Grid;
using ChildGridProperties.Models;
using System.Collections;
|
@(Html.EJ().Grid<GetCapacitacionesResults>("GridCapacitaciones") .Datasource((IEnumerable< GetCapacitacionesResults>)ViewBag.datasource) .Columns(col => { col.Field("capacitacion_id").Width(75).Add(); col.Field("FirstName").Width(100).Add(); col.Field("Title").Width(120).Add(); col.Field("City").Width(100).Add(); col.Field("Country").Width(100).Add(); }) .ChildGrid<GetCapacitacionParticipantesResult>( child => child.QueryString("capacitacion_id") .AllowPaging() .IsResponsive() .EnableResponsiveRow() .AllowFiltering() .FilterSettings(filter => { filter.FilterType(FilterType.Excel); }) .Columns(col => { col.Field(p => p.FullName).HeaderText("Empleado").Width(35).TextAlign(Syncfusion.JavaScript.TextAlign.Right).Add(); col.Field(p => p.Empresa).HeaderText("Empresa").Width(35).TextAlign(Syncfusion.JavaScript.TextAlign.Right).Add(); col.Field(p => p.Dpto).HeaderText("Departamento").Width(35).TextAlign(Syncfusion.JavaScript.TextAlign.Right).Add(); }) .ClientSideEvents(eve => { eve.Load("loadEvent"); }) ) ) |
<script type="text/javascript"> function loadEvent(args) { var data = this .model.parentDetails.parentKeyFieldValue; this.model.dataSource = ej.DataManager({ url: "/CapitalHumano/GetParticipantes?capacitacion_id=" + data + "", adaptor: "UrlAdaptor" }); } </script> |
public ActionResult GetParticipantes(int? capacitacion_id) { IEnumerable data = capacitacion.getListadoParticipantes(capacitacion_id).ToList(); return Json(data, JsonRequestBehavior.AllowGet); } |
public ActionResult ChildData(DataManager dm,int ? EmployeeID)
{
IEnumerable data = OrderRepository.GetAllRecords().ToList();
DataResult result = new DataResult();
DataOperations operation = new DataOperations();
result.result = data;
result.result = operation.Execute(data, dm);
result.count = data.AsQueryable().Count();
return Json(result, JsonRequestBehavior.AllowGet);
} |