Created
October 25, 2018 14:13
-
-
Save andiih/5a627d694b921b4bf3bb46e0a7ba19e3 to your computer and use it in GitHub Desktop.
A view ready for the MVC controller and StandardGridBuilder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @using System.Collections | |
| @using FiftyEggs.Data.Models | |
| @using Kendo.Mvc.UI | |
| @{ | |
| var cn = (string)ViewBag.ControllerName; | |
| var builder = new StandardGrid<Job>(cn, Url); | |
| } | |
| <h2>@cn</h2> | |
| @(builder.Build(Html.Kendo().Grid<Job>(), | |
| m => | |
| { | |
| m.Id(p => p.Id); | |
| m.Field(f => f.CustomerId).DefaultValue(1); | |
| m.Field(f => f.MaterialStatusId).DefaultValue(1); | |
| }).Columns( | |
| cols => | |
| { | |
| cols.Bound(c => c.Id); | |
| cols.ForeignKey(c => c.CustomerId, (IEnumerable)ViewData["customers"], "Id", "Desc").Title("Customer").Width(75); | |
| cols.Bound(c => c.PartNoDesc); | |
| cols.ForeignKey(c => c.MaterialStatusId, (IEnumerable)ViewData["matstats"], "Id", "Status").Title("Material Status"); | |
| cols.Command(c => c.Destroy()); | |
| } | |
| ) | |
| ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment