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"
)
)
<div class=
"draggable"
>
drag me
</div>
<div id=
"test-area"
>
<h2>
Test area
</h2>
<h2>
Test area
</h2>
<h2>
Test area
</h2>
<h2>
Test area
</h2>
<h2>
Test area
</h2>
<h2>
Test area
</h2>
<h2>
Test area
</h2>
</div>
<script>
$(document).ready(
function
() {
$(
"#test-area"
).kendoDropTargetArea({
dragenter: DragAndDrop.dropTargetOnDragEnter,
dragleave: DragAndDrop.dropTargetOnDragLeave,
drop: DragAndDrop.dropTargetOnDrop
});
$(
".draggable"
).kendoDraggable({
hint:
function
() {
return
$(
".draggable"
).clone();
},
dragstart: DragAndDrop.draggableOnDragStart,
dragend: DragAndDrop.draggableOnDragEnd
});
});
var
DragAndDrop = {
draggableOnDragStart:
function
(e) {
$(
".draggable"
).addClass(
"hollow"
);
$(
".draggable"
).css(
"cursor"
,
"no-drop"
);
e.currentTarget.hide();
},
draggableOnDragEnd:
function
(e) {
e.currentTarget.show();
},
dropTargetOnDrop:
function
() {
alert(2);
},
dropTargetOnDragEnter:
function
() {
alert(1);
$(
".draggable"
).css(
"cursor"
,
"wait"
);
},
dropTargetOnDragLeave:
function
() {
alert(3);
}
};
</script>
.Columns(c =>
{
c.Bound(col => col.ActiveBool).Width(12).Title(
"Active"
).HtmlAttributes(
new
{ @
class
=
"visible-xs visible-lg visible-sm"
});
c.Bound(col => col.District).Width(12).Title(
"Dist"
).HtmlAttributes(
new
{ @
class
=
"visible-xs visible-lg visible-sm"
});
c.Bound(col => col.ContractId).ClientTemplate(@Html.ActionLink(
"#= ContractId #"
,
"ActiveContracts"
,
"ActiveContracts"
,
new
{ id =
"#= ContractId #"
, @
class
=
"visible-sm visible-lg visible-xs"
},
null
).ToHtmlString()).Width(16);
c.Bound(col => col.Status).Width(23).HtmlAttributes(
new
{ @
class
=
"visible-lg"
});
c.Bound(col => col.WorkBeginDate).Width(17).Title(
"Work Begin"
).HtmlAttributes(
new
{ @
class
=
"visible-lg"
});
c.Bound(col => col.CurrentAmount).Width(20).HtmlAttributes(
new
{ @
class
=
"visible-lg"
});
c.Bound(col => col.ProjectId).Width(18).HtmlAttributes(
new
{ @
class
=
"visible-lg"
});
c.Bound(col => col.DescriptionTrimmed).Width(33).HtmlAttributes(
new
{ title =
"<#=Description#>"
}).Title(
"Description"
).HtmlAttributes(
new
{ @
class
=
"visible-lg"
});
c.Bound(col => col.County).Width(15).HtmlAttributes(
new
{ @
class
=
"visible-lg"
});
c.Bound(col => col.WorkMixTrimmed).Width(22).HtmlAttributes(
new
{ title =
"<#=WorkMix#>"
}).Title(
"Work Mix"
).HtmlAttributes(
new
{ @
class
=
"visible-lg"
});
c.Bound(col => col.VendorNameTrimmed).Width(22).HtmlAttributes(
new
{ title =
"<#=VendorName#>"
}).Title(
"Vendor Name"
).HtmlAttributes(
new
{ @
class
=
"visible-xs visible-lg visible-sm"
});
c.Bound(col => col.ViewMap).Width(15).HtmlAttributes(
new
{ @
class
=
"visible-xs visible-lg visible-sm"
});
})