Az első RecroGrid |
A legegyszerűbb megjelenítési mód, egy Entitás alapján létrehozott a RecroGrid.
public class NorthwindController : Controller { public ActionResult Product() { return View(new RecroGridDBC<Products, AdventureWorksDBContext>(new RecroGridContext(this.HttpContext), new AdventureWorksDBContext())); } }
@model Recrovit.RecroGridFramework.RecroGrid
@section htmlhead {
@*RecroGrid Framework globális stílusok*@
@Html.Raw(Recrovit.RecroGridFramework.RecroGrid.RecroGridStylesheetsReferences)
@*Az aktuális Entitáshoz tartozó stílusok*@
@Html.Raw(Model.StylesheetsReferences)
}
<h4>@(ViewBag.Title ?? Model.Title)</h4>
<section>
<div>
@*Konténer template a megjelenítéshez*@
@Html.Raw(Model.Skeleton)
</div>
</section>
@section scripts {
@*A kliensoldali osztályok inicializálása*@
@Html.Raw(Model.CreateScript)
}Ez a módszer egyszerű és gyors, de javasolt inkább minden entitáshoz egyedi osztályt kialakítani. |
public partial class RG_Product : RecroGridDBC<Product, AdventureWorksDBContext> { public RG_Product(IRecroGridContext rgContext) : base(rgContext, new AdventureWorksDBContext()) { } }
public class NorthwindController : Controller { public ActionResult Product() { return View(new RG_Product(new RecroGridContext(this.HttpContext))); } } }