or
@(Html.Kendo().Grid<
SHDIncident
>(Model.SHDActive)
.Name("shdActive")
.Columns(columns =>
{
columns.Bound(e => e.SHDEntryId);
columns.Bound(e => e.AffectedWorkload);
columns.Bound(e => e.Severity);
columns.Bound(e => e.Status);
columns.Bound(e => e.AffectedDataCenters);
columns.Bound(e => e.StartTime);
columns.Bound(e => e.LastUpdatedTime);
})
.ClientDetailTemplateId("shddetailTemplate")
)
<script>
function contractorChanged() {
$.ajax({
type:
"POST"
,
url:
'@Url.Action("GetContactPersons", "Permission")'
,
data: {
id: $(
"#ContractorId"
).val()
},
cache:
false
,
success: function (data) {
$(
"#ContractorPersonId"
).data(
"kendoDropDownList"
).setDataSource(data);
$(
"#ContractorPersonId"
).data(
"kendoDropDownList"
).value(
'@Model.ContractorPersonId'
);
}
});
}
</script>
@(Html.Kendo().DropDownListFor(model => model.ContractorId)
.HtmlAttributes(
new
{ style =
"width:100%; margin-bottom: 8px;"
})
.OptionLabel(
"Välj företag"
)
.DataTextField(
"Name"
)
.DataValueField(
"Id"
)
.Events(e => e.DataBound(
"contractorChanged"
))
.DataSource(source =>
{
source.Read(read => { read.Action(
"GetConstructors"
,
"Permission"
); });
}))
@(Html.Kendo().DropDownListFor(model => model.ContractorPersonId)
.HtmlAttributes(
new
{ style =
"width:100%"
})
.OptionLabel(
"Välj kontaktperson"
)
.DataTextField(
"FullName"
)
.DataValueField(
"Id"
)
.Enable(
false
)
.AutoBind(
false
)
.CascadeFrom(
"ContractorId"
)
)