or
001.@(Html.Kendo().Menu()002. .HighlightPath(true)003. .Name("Menu")004. .Items(items =>005. {006. items.Add()007. .Text("Home")008. .Items(children =>009. {010. children.Add().Text("Website Home");011. children.Add().Text("Application Home").Action("Index", "Home");012. }); 013. 014. items.Add()015. .Text("Company")016. .Items(children =>017. {018. children.Add().Text("Events")019. .Items(innerChildren =>020. {021. innerChildren.Add().Text("List");022. //.Action("Index", "CompanyEvents");023. innerChildren.Add().Text("Calendar View");024. //.Action("Calendar", "CompanyEvents");025. });026. 027. children.Add().Text("Departments");028. //.Action("Index", "Department");029. 030. 031. children.Add().Text("Configure")032. .Items(innerChildren =>033. {034. innerChildren.Add().Text("Benefit Year");035. //.Action("Index", "BenefitYear");036. innerChildren.Add().Text("Employee Types").Action("Index", "EmployeeType");037. innerChildren.Add().Text("Holidays").Action("Index", "Holiday");038. innerChildren.Add().Text("Job Codes").Action("Index", "JobCode");039. innerChildren.Add().Text("PTO Request Status Codes").Action("Index", "RequestStatusCode");040. innerChildren.Add().Text("PTO Acrual").Action("Index", "PTOAcrual");041. });042. 043. });044. 045. items.Add()046. .Text("Employee")047. .Items(children =>048. {049. children.Add().Text("Employee Search");050. //.Action("Index", "Employee");051. children.Add().Text("Employee Grid");052. //.Action("IndexGrid", "Employee");053. 054. children.Add().Text("PTO Request")055. .Items(innerChildren =>056. {057. innerChildren.Add().Text("List").Action("Index", "PTORequest");058. innerChildren.Add().Text("New PTO Request").Action("Create", "PTORequest");059. });060. 061. children.Add().Text("Edit Personal Data").Action("Edit", "Employee", new { id = EmpId });062. children.Add().Text("Employee Profile")063. .Items(innerChildren =>064. {065. innerChildren.Add().Text("List").Action("Index", "EmployeeProfile");066. //innerChildren.Add().Text("Edit my Profile").Action("Edit", "EmployeeProfile", new { id = EmpProfileId });067. innerChildren.Add().Text("Edit my Profile").Action("Edit", "EmployeeProfile");068. });069. 070. children.Add().Text("Sanction")071. .Items(innerChildren =>072. {073. innerChildren.Add().Text("List").Action("Index", "Sanction");074. innerChildren.Add().Text("New Sanction").Action("Create", "Sanction");075. });076. 077. children.Add().Text("Attendance Log")078. .Items(innerChildren =>079. {080. innerChildren.Add().Text("List").Action("Index", "AttendanceLog");081. innerChildren.Add().Text("New Attendance Log").Action("Create", "AttendanceLog");082. });083. 084. children.Add().Text("Timesheet")085. .Items(innerChildren =>086. {087. innerChildren.Add().Text("List").Action("Index", "TimeSheet");088. innerChildren.Add().Text("List (Grid)").Action("IndexGrid", "TimeSheet");089. innerChildren.Add().Text("New Timesheet").Action("Create", "Timesheet");090. });091. 092. });093. 094. 095. items.Add()096. .Text("Admin").HtmlAttributes(new { id="admin"})097. .Items(children =>098. {099. children.Add().Text("Company").Action("Index", "Company");100. children.Add().Text("Subscription Level").Action("Index", "SubscriptionLevel");101. children.Add().Text("Subscription Limits").Action("Index", "SubscriptionLimit");102. children.Add().Text("PTO Pool Type").Action("Index", "PTOPoolType");103. children.Add().Text("Absence Code").Action("Index", "AbscenceCode");104. children.Add().Text("Timesheet Status Codes").Action("Index", "TimesheetStatusCode");105. children.Add().Text("Activity Log").Action("Index", "ActivityLog");106. children.Add().Text("Release History").Action("Index", "ReleaseHistory");107. children.Add().Text("Report List").Action("Index", "Report");108. children.Add().Text("Suggestion List").Action("Index", "UserSuggestion");109. children.Add().Text("Create Employee w/o User").Action("Create", "Employee");110. }).Enabled(false);111. 112. //items.Add().Text("About");113. //items.Add().Text("Contact");114. })115. )function SetItemGridView(isManual) { var itemGrid = $("#ItemGrid").data("kendoGrid"); if (isManual) { itemGrid.showColumn("MyTestCol"); } else { itemGrid.hideColumn("MyTestCol"); }}function ConfigureItemGrid(e) { SetItemGridView($("#IsManual").length > 0 ? $("#IsManual").is(":checked") : true);}@(Html.Kendo().Grid(Model) .Name("ItemGrid") .Columns(columns => { columns.Bound(i => i.MyTestCol).Width(100); columns.Command(command => { command.Destroy(); }).Width(60); }) .Events(e => { e.DataBound("ConfigureItemGrid"); e.Edit("onItemGridEdit"); }) .ToolBar(toolbar => { toolbar.Create(); }) .Editable(editable => { editable.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Bottom); }) .Navigatable(navigatable => navigatable.Enabled(true)) .DataSource(dataSource => dataSource .Ajax() .Batch(true) .ServerOperation(false) .Model(model => { model.Id(i => i.ItemModelID); }) .Create(create => create.Action("CreateProducts", "ItemGrid")) .Read(read => read.Action("GetProducts", "ItemGrid")) .Update(update => update.Action("UpdateProducts", "ItemGrid")) .Destroy(destroy => destroy.Action("DeleteProducts", "ItemGrid")) ))public JsonResult JsonIndex(){ var menus = _db.GetMenus( 0, 1, 1, 0 ); var allMenus = from m in menus where m.MenuId == 1 select new { Name = m.MenuName, ImageUrl = m.MenuImageUrl, NavUrl = m.MenuNavUrl, hasChildren = true, children = from m2 in menus where m2.ParentMenuId == m.MenuId select new { Name = m2.MenuName, ImageUrl = m2.MenuImageUrl, NavUrl = m2.MenuNavUrl, hasChildren = false, } }; JsonResult json = Json( allMenus, JsonRequestBehavior.AllowGet ); return ( json );}<script> $(document).ready(function () { function populateTreeView() { var remoteDataSource = new kendo.data.HierarchicalDataSource({ type: "json", transport: { read: "Home/JsonIndex" }, schema: { model: { text: "Name", ImageUrl: "ImageUrl", expanded: true, children: "children", hasChildren: "hasChildren", NavUrl: "NavUrl" } } }); $("#tv").kendoTreeView({ id: "tree123", Name: "tree123", dataSource: remoteDataSource, dataTextField: "Name", dataImageUrlField: "ImageUrl", select: onTreeViewSelect }); } $(document).ready(function () { populateTreeView(); }); }); </script>public class HomeController : Controller { // // GET: /Home/ [HttpGet] public ActionResult Index() { return View(); } // Carrier Actions // // POST: /ReadCarriers/ [HttpPost] public ActionResult CarrierRead([DataSourceRequest] DataSourceRequest request) { try { var facade = new CarrierFacade(); IList<Carrier> carriers = facade.GetAllCarriers(); return Json(carriers.ToDataSourceResult(request)); } catch (DbException ex) { ViewBag.ErrorMessage = ex.Message; return View("Error"); } } // Comment Actions // // POST: /CommentRead/ [HttpPost] public ActionResult CommentRead([DataSourceRequest] DataSourceRequest request, int carrierId) { try { var facade = new CarrierFacade(); IList<CarrierComment> comments = facade.GetAllComments(carrierId); return Json(comments.ToDataSourceResult(request)); } catch (DbException ex) { ViewBag.ErrorMessage = ex.Message; return View("Error"); } }}@using HappyHolidays.WebPortal.BusinessObjects@{ ViewBag.Title = "Carrier Directory";}@(Html.Kendo().Grid<Carrier>() .Name("grid") .Columns(columns => { columns.Bound(p => p.Name).Groupable(false); columns.Bound(p => p.Phone1).Groupable(false).Title("Primary Phone"); columns.Bound(p => p.Phone2).Groupable(false).Title("Secondary Phone"); columns.Bound(p => p.Fax).Groupable(false); columns.Command(command => { command.Edit(); command.Destroy(); }); }) .ToolBar(toolbar => toolbar.Create()) .Editable(editable => editable.Mode(GridEditMode.PopUp)) .Groupable() .Pageable() .Sortable() .Scrollable() .Filterable() .Selectable() .Resizable(resize => resize.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .ClientDetailTemplateId("carrier-detail") .DataSource( dataSource => dataSource .Ajax() .PageSize(50) .Model(model => { model.Id(p => p.CarrierId); model.Field(p => p.CarrierId).Editable(false); }) .Create(update => update.Action("CarrierCreate", "Home")) .Update(update => update.Action("CarrierUpdate", "Home")) .Destroy(update => update.Action("CarrierDelete", "Home")) .Read(read => read.Action("CarrierRead", "Home"))))<script id="carrier-detail" type="text/x-kendo-template"> @(Html.Kendo().Grid<CarrierComment>() .Name("commentsGrid#=CarrierId#") .Columns(columns => { columns.Bound(o => o.Comment); columns.Bound(o => o.AddedBy); columns.Bound(o => o.TimeStamp); }) .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("CommentRead", "Home", new { carrierID = "#=CarrierId#" })) ) .Pageable() .Sortable() .ToClientTemplate() )</script><!DOCTYPE html><html><head> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/kendo/2013.1.514/kendo.common.min.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/kendo/2013.1.514/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/kendo/2013.1.514/kendo.metro.min.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/kendo/2013.1.514/kendo.dataviz.metro.min.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/kendo/2013.1.514/jquery.min.js")"> </script> <script src="@Url.Content("~/Scripts/kendo/2013.1.514/kendo.all.min.js")"> </script> <script src="@Url.Content("~/Scripts/kendo/2013.1.514/kendo.aspnetmvc.min.js")"> </script> <script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"> </script></head><body> <div> @RenderBody() </div></body></html><script id="shipmentDetail-template" type="text/x-kendo-template">--- lots of template code removed for brevity --- # var myVal; var cr = data.CustomerReference; for (var key in cr) { if (cr.hasOwnProperty(key)) { myVal = cr[key]; # #= myVal # , # } } #</script>