or
function
createChart(id, search_type, breakdown) {
var
data = $(
'#form-search_analytics'
).serialize();
$(
"#loading"
+id).show();
$(
'#'
+id).kendoChart({
dataSource: {
transport: {
read: {
url:
'<?php echo $this->url('
analytics/
default
', array('
controller
'=>'
index
', '
action
'=>'
ajax-get-chart-data
')) ?>?type='
+search_type+
'&'
+data,
dataType:
"json"
,
type:
"GET"
,
cache:
false
}
}
},
dataBound:
function
(){
console.log(
'#loading-'
+id);
$(
'#loading-'
+id).hide();
},
seriesClick:
function
(e) {
console.log(e.series.name);
loadSeriesBreakdownPanel(e.series.name, search_type, data);
},
title: {
text: search_type
},
legend: {
position:
"right"
},
seriesDefaults: {
type:
"area"
,
//type: "line"
stack:
true
},
series: series[search_type],
categoryAxis: {
field:
"Date"
,
labels: {
rotation: -30
}
},
valueAxis: {
labels: {
format:
"N0"
}
},
tooltip: {
visible:
true
,
format:
"N0"
,
template:
"#: series.name #: #: value #"
}
});
}
function
handleCloseClick() {
$(
'.analytics-chart.k-chart'
).each(
function
(){
var
id = $(
this
).attr(
'id'
);
var
chart = $(
'#'
+id).data(
"kendoChart"
);
chart.destroy();
$(
'#'
+id).empty();
});
}
<
div
id
=
"results"
>
<
div
class
=
"chart-panel"
>
<
h3
>Breakdown by Document</
h3
>
<
div
class
=
"analytics-chart"
id
=
"chart-Document"
data-type
=
"Document"
></
div
>
<
div
id
=
"loading-chart-Document"
></
div
>
</
div
>
</
div
>
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);
}
}