or
var onSelect = function (e) { var dataItem = this.dataItem(e.item.index()); CCCOnline.changeAccount(dataItem.AccountNumberId);};$("#clientAcctsMenuKendo").data("kendoDropDownList").bind("select", onSelect);@(Html.Kendo().DropDownList() .Name("clientMenu") .BindTo(Model.ClientAccountList) .DataValueField("Serialized") .DataTextField("Display") .Events(e => e.Change("CCCOnline.changeAccount(this);")) .Value(selected))@model Domain.Loan@(Html.Kendo().Grid<AmortizationScheduleGridModel>() .Name("AmortizationScheduleGrid") .Columns(columns => { columns.Bound(p => p.AmortizationLineId).Visible(false); columns.Bound(p => p.LineNumber); columns.Bound(p => p.PrincipalPaid).Title("Principal").Format("{0:c}") .ClientTemplate("# if (!IsPrincipalSatisfied) { #" + "<span class='not-satisfied'>" + "#=PrincipalPaid#" + "</span>" + "<span class='expected'> (#=PrincipalExpected#)</span>" + "# } else { #" + "<span class='satisfied'>" + "#=PrincipalPaid#" + "</span>" + " <span class='expected'>(#=PrincipalExpected#)</span>" + "# } #") .ClientFooterTemplate("<b>#=sum#</b><input id='pmtTotal' type='hidden' value='#=sum#' />"); columns.Bound(p => p.InterestPaid).Format("{0:c}"); columns.Bound(p => p.LateFeesPaid).Format("{0:c}"); columns.Bound(p => p.SpecialFeesPaid).Format("{0:c}"); columns.Bound(p => p.SpecialFeesComments); columns.Bound(p => p.AmortizationPrincipalBalance); columns.Bound(p => p.ActualPrincipalBalance); }) .ClientDetailTemplateId("paymentApplicationTemplate") .Sortable() .Scrollable() .DataSource(dataSource => dataSource .Ajax() .Aggregates(agg => { agg.Add(al => al.PrincipalPaid).Sum(); }) .Read(read => read.Action("CustomerAmortizationScheduleRead", "Payments", new { loanId = Model.Id })) ) .Events(ev => ev.DataBound("amoritzationDataBound")) .ToolBar(tb => { tb.Custom().Action<PaymentsController>(pc => pc.PrintLoanPayments(Model.Id)).Text("Print").Name("Print"); tb.Template("<button type='button' class='k-button k-button-icontext' onclick='toggleAmortizationPayments()'>Toggle Open</button>"); }) )<script id="paymentApplicationTemplate" type="text/kendo-tmpl"> @(Html.Kendo().Grid<PaymentApplicationModel>() .Name("paymentApplication_#=AmortizationLineId#") .Columns(columns => { columns.Bound(p => p.PaymentApplicationId).Visible(false); columns.Bound(p => p.DueDate).Title("Due").Format("{0:MM/dd/yyyy}"); columns.Bound(p => p.AmortizationLineNumber).Title("Line"); columns.Bound(p => p.PrincipalApplied).Title("Principal").Format("{0:c}") .ClientTemplate("\\# if (!IsPrincipalSatisfied) { \\#" + "<span class='not-satisfied'>" + "\\#=PrincipalApplied\\#" + "</span>" + "<span class='expected'> (\\#=PrincipalExpected\\#)</span>" + "\\# } else { \\#" + "<span class='satisfied'>" + "\\#=PrincipalApplied\\#" + "</span>" + " <span class='expected'>(\\#=PrincipalExpected\\#)</span>" + "\\# } \\#"); columns.Bound(p => p.InterestApplied).Title("Interest").Format("{0:c}") .ClientTemplate("\\# if (!IsInterestSatisfied) { \\#" + "<span class='not-satisfied'>" + "\\#=InterestApplied\\#" + "</span>" + "<span class='expected'> (\\#=InterestExpected\\#)</span>" + "\\# } else { \\#" + "<span class='satisfied'>" + "\\#=InterestApplied\\#" + "</span>" + " <span class='expected'>(\\#=InterestExpected\\#)</span>" + "\\# } \\#"); columns.Bound(p => p.LateFeesApplied).Title("Late").Format("{0:c}") .ClientTemplate("\\# if (!IsLateFeeSatisfied) { \\#" + "<span class='not-satisfied'>" + "\\#=LateFeesApplied\\#" + "</span>" + "<span class='expected'> (\\#=LateFeesExpected\\#)</span>" + "\\# } else { \\#" + "<span class='satisfied'>" + "\\#=LateFeesApplied\\#" + "</span>" + " <span class='expected'>(\\#=LateFeesExpected\\#)</span>" + "\\# } \\#"); columns.Bound(p => p.SpecialFeesApplied).Title("Special Fees").Format("{0:c}").ClientTemplate("\\# if (!IsSpecialFeeSatisfied) { \\#" + "<span class='not-satisfied'>" + "\\#=SpecialFeesApplied\\#" + "</span>" + "<span class='expected'> (\\#=SpecialFeesExpected\\#)</span>" + "\\# } else { \\#" + "<span class='satisfied'>" + "\\#=SpecialFeesApplied\\#" + "</span>" + " <span class='expected'>(\\#=SpecialFeesExpected\\#)</span>" + "\\# } \\#"); }) .DataSource(dataSource => dataSource .Ajax() .PageSize(5) .Read(read => read.Action("PaymentApplicationsReadByAmortizationLine", "Payments", new { amortizationLineId = "#=AmortizationLineId#" })) ) .ToClientTemplate() )</script><script type="text/javascript"> var amortizationPaymentsExpanded = false; function amoritzationDataBound() { } function toggleAmortizationPayments() { var paymentHistoryGrid = $("#AmortizationScheduleGrid").data("kendoGrid"); if (!amortizationPaymentsExpanded) { paymentHistoryGrid.expandRow(paymentHistoryGrid.tbody.find("tr.k-master-row")); amortizationPaymentsExpanded = true; } else { paymentHistoryGrid.collapseRow(paymentHistoryGrid.tbody.find("tr.k-master-row")); amortizationPaymentsExpanded = false; } }</script>@model Tristate.Domain.Loan<style> .k-grid td { font-size: 12px; }</style>@(Html.Kendo().Grid<AmortizationScheduleGridModel>() .Name("AmortizationScheduleGrid") .Columns(columns => { columns.Bound(p => p.AmortizationLineId).Visible(false); columns.Bound(p => p.LineNumber); columns.Bound(p => p.PrincipalPaid).Title("Principal").Format("{0:c}") .ClientTemplate("# if (!IsPrincipalSatisfied) { #" + "<span class='not-satisfied'>" + "#=PrincipalPaid#" + "</span>" + "<span class='expected'> (#=PrincipalExpected#)</span>" + "# } else { #" + "<span class='satisfied'>" + "#=PrincipalPaid#" + "</span>" + " <span class='expected'>(#=PrincipalExpected#)</span>" + "# } #") .ClientFooterTemplate("<b>#=sum#</b><input id='pmtTotal' type='hidden' value='#=sum#' />"); columns.Bound(p => p.InterestPaid).Format("{0:c}"); columns.Bound(p => p.LateFeesPaid).Format("{0:c}"); columns.Bound(p => p.SpecialFeesPaid).Format("{0:c}"); columns.Bound(p => p.SpecialFeesComments); columns.Bound(p => p.AmortizationPrincipalBalance); columns.Bound(p => p.ActualPrincipalBalance); }) .ClientDetailTemplateId("paymentApplicationTemplate") .Sortable() .Scrollable() .DataSource(dataSource => dataSource .Ajax() .Aggregates(agg => { agg.Add(al => al.PrincipalPaid).Sum(); }) .Read(read => read.Action("CustomerAmortizationScheduleRead", "Payments", new { loanId = Model.Id })) ) .Events(ev => ev.DataBound("amoritzationDataBound")) .ToolBar(tb => { tb.Custom().Action<PaymentsController>(pc => pc.PrintLoanPayments(Model.Id)).Text("Print").Name("Print"); tb.Template("<button type='button' class='k-button k-button-icontext' onclick='toggleAmortizationPayments()'>Toggle Open</button>"); }) )<script id="paymentApplicationTemplate" type="text/kendo-tmpl"> @(Html.Kendo().Grid<PaymentApplicationModel>() .Name("paymentApplication_#=AmortizationLineId#") .Columns(columns => { columns.Bound(p => p.PaymentApplicationId).Visible(false); columns.Bound(p => p.DueDate).Title("Due").Format("{0:MM/dd/yyyy}"); columns.Bound(p => p.AmortizationLineNumber).Title("Line"); columns.Bound(p => p.PrincipalApplied).Title("Principal").Format("{0:c}") .ClientTemplate("\\# if (!IsPrincipalSatisfied) { \\#" + "<span class='not-satisfied'>" + "\\#=PrincipalApplied\\#" + "</span>" + "<span class='expected'> (\\#=PrincipalExpected\\#)</span>" + "\\# } else { \\#" + "<span class='satisfied'>" + "\\#=PrincipalApplied\\#" + "</span>" + " <span class='expected'>(\\#=PrincipalExpected\\#)</span>" + "\\# } \\#"); columns.Bound(p => p.InterestApplied).Title("Interest").Format("{0:c}") .ClientTemplate("\\# if (!IsInterestSatisfied) { \\#" + "<span class='not-satisfied'>" + "\\#=InterestApplied\\#" + "</span>" + "<span class='expected'> (\\#=InterestExpected\\#)</span>" + "\\# } else { \\#" + "<span class='satisfied'>" + "\\#=InterestApplied\\#" + "</span>" + " <span class='expected'>(\\#=InterestExpected\\#)</span>" + "\\# } \\#"); columns.Bound(p => p.LateFeesApplied).Title("Late").Format("{0:c}") .ClientTemplate("\\# if (!IsLateFeeSatisfied) { \\#" + "<span class='not-satisfied'>" + "\\#=LateFeesApplied\\#" + "</span>" + "<span class='expected'> (\\#=LateFeesExpected\\#)</span>" + "\\# } else { \\#" + "<span class='satisfied'>" + "\\#=LateFeesApplied\\#" + "</span>" + " <span class='expected'>(\\#=LateFeesExpected\\#)</span>" + "\\# } \\#"); columns.Bound(p => p.SpecialFeesApplied).Title("Special Fees").Format("{0:c}").ClientTemplate("\\# if (!IsSpecialFeeSatisfied) { \\#" + "<span class='not-satisfied'>" + "\\#=SpecialFeesApplied\\#" + "</span>" + "<span class='expected'> (\\#=SpecialFeesExpected\\#)</span>" + "\\# } else { \\#" + "<span class='satisfied'>" + "\\#=SpecialFeesApplied\\#" + "</span>" + " <span class='expected'>(\\#=SpecialFeesExpected\\#)</span>" + "\\# } \\#"); }) .DataSource(dataSource => dataSource .Ajax() .PageSize(5) .Read(read => read.Action("PaymentApplicationsReadByAmortizationLine", "Payments", new { amortizationLineId = "#=AmortizationLineId#" })) ) .ToClientTemplate() )</script><script type="text/javascript"> var amortizationPaymentsExpanded = false; function amoritzationDataBound() { } function toggleAmortizationPayments() { var paymentHistoryGrid = $("#AmortizationScheduleGrid").data("kendoGrid"); if (!amortizationPaymentsExpanded) { paymentHistoryGrid.expandRow(paymentHistoryGrid.tbody.find("tr.k-master-row")); amortizationPaymentsExpanded = true; } else { paymentHistoryGrid.collapseRow(paymentHistoryGrid.tbody.find("tr.k-master-row")); amortizationPaymentsExpanded = false; } }</script><!DOCTYPE html><html><head> <title></title> <link href="styles/kendo.common.min.css" rel="stylesheet" /> <link href="styles/kendo.rtl.min.css" rel="stylesheet" /> <link href="styles/kendo.default.min.css" rel="stylesheet" /> <link href="styles/kendo.dataviz.min.css" rel="stylesheet" /> <link href="styles/kendo.dataviz.default.min.css" rel="stylesheet" /> <script src="js/jquery.min.js"></script> <script src="js/kendo.all.min.js"></script> </head><body> <div id="example" class="k-content absConf"> <table class="history" > <tr> <td class="spark" style="border: 1px solid red"><span id="Old1T"></span></td> <td class="spark" style="border: 1px solid red"><span id="Old2T"></span></td> <td class="spark" style="border: 1px solid red"><span id="New1T"></span></td> <td class="spark" style="border: 1px solid red"><span id="New2T"></span></td> <td class="spark" style="border: 1px solid red"><span id="New3T"></span></td> <td class="spark" style="border: 1px solid red"><span id="New4T"></span></td> <td class="spark" style="border: 1px solid red"><span id="New5T"></span></td> </tr> </table> <script> function bindChart(tech, Side) { var rowDataSource = new kendo.data.DataSource({ transport: { read: { url: "http://localhost:3118/Service1.svc/GetLaunchedSites?Technology=" + tech + "&Side=" + Side, type: 'GET', jsonpCallback: 'callback', dataType: "jsonp" } } }); $("#" + tech + Side + "T").kendoSparkline({ dataSource: rowDataSource, series: [{ field: "count", color: "Green" }], seriesDefaults: { type: "area" }, }); } function drawChart() { bindChart("Old", 1); bindChart("Old", 2); bindChart("New", 1); bindChart("New", 2); bindChart("New", 3); bindChart("New", 4); bindChart("New", 5); } $(document).ready(drawChart); $(document).bind("kendo:skinChange", drawChart); </script> <style scoped> .chart-wrapper { width: 200px; height: 100%; margin: 0 auto 30px auto; padding: 0 0 30px 0; font-weight: bold; text-transform: uppercase; } .history td.spark { text-align: left; line-height: 50px; padding: 0 5px; } </style> </div></body></html>@using (Html.BeginForm("Security", "Security", FormMethod.Post)){ <label for="roles" class="field-label">Securities by Role:</label> @(Html.Kendo().DropDownList() .Name("roles") .DataTextField("RoleName") .DataValueField("ID") .Events(e => e.Change("rolesChange")) .DataSource(ds => ds.Read("GetRoles", "Security")) ) <a href="#" id="saveButton" class="k-button k-button-icontext"><span class="k-icon k-update"></span>Save</a> <div class="treeview-back"> @(Html.Kendo().TreeView() .Name("treeview") .DataTextField("Text") .AutoBind(false) .Checkboxes(checkboxes => checkboxes.CheckChildren(true)) .Items(tv => { var list = Model.ToList(); foreach (var client in list) { tv.Add().Text(client.Name) .Id("cvm" + client.ID) .Items(root => { foreach (var campaign in client.Campaigns) { root.Add() .Text(campaign.CampaignName) .Id(campaign.ID.ToString()) .Checked(campaign.IsSelected); } }); } })) </div> }
<script>
var treeview = $("#treeview").data("kendoTreeView");
function rolesChange(e) {
var treeview = $("#treeview").data("kendoTreeView");
var value = this.value();
if (value) {
var url = '@Url.Action("Security", "Security")' + "?roleId=" + value;
$.ajax({
url: url,
type: 'POST',
});
}
}
</script>
public class SecurityController : BaseGridCrudController<SecurityDataMapper, SecurityViewModel>{ public ActionResult Security(int roleId = 0) { return View(GetTreeViewData(roleId == 0 ? (int?)null : roleId)); } protected override string ClassName { get { return "SecurityController"; } } public List<ClientViewModel> GetTreeViewData(int? id) { int? roleId = id; if (!roleId.HasValue) { var roleViewModels = RoleDataMapper.Instance.List().OrderBy(r => r.RoleName); RoleViewModel roleViewModel = roleViewModels.First(); roleId = roleViewModel.ID; } return _dataMapper.LoadByRoleId(roleId.Value); } public ActionResult GetRoles() { var roles = RoleDataMapper.Instance.List().OrderBy(r => r.RoleName); return Json(roles, JsonRequestBehavior.AllowGet); }}var dsOpts = { transport: { read: { url: function() { if(displayMode == "items") return "Coverage/GetFolderItemsByPage"; else if(displayMode == "filter") return "Coverage/GetFilterItemsByPage"; }, dataType: "json", data: function () { if (displayMode == "items") { return { folderId: function () { return $("#treeview").data("kendoTreeView").dataItem("#treeview_tv_active").FolderId }, sourceTypeFilter: function () { if ($("#optSourceType").length > 0) return $("#optSourceType").find(".k-state-selected").attr("value"); else return ""; } }; } else if (displayMode == "filter") { return getFilterItems(); } } } }, serverPaging: true, schema: { data: "MediaItems", total: function (response) { return response.Total; }, model: ItemModel, id: "ItemId" }, pageSize: 100, requestStart: function (e) { kendo.ui.progress($(".image-preview-list"), false); }, requestEnd: function (e) { resizeSliders(); if (displayMode == "items") { if (typeof $("#treeview").data("kendoTreeView").dataItem("#treeview_tv_active") != 'undefined') $("#hdrFolderName").html("Now Displaying Folder: " + $("#treeview").data("kendoTreeView").dataItem("#treeview_tv_active").Name); } else { $("#hdrFolderName").html("Now Displaying Filtered Results"); } }};MediaItems = new kendo.data.DataSource(dsOpts);$("#divPaging").kendoPager({ dataSource: MediaItems});