I am trying to use a custom command but its not working it refuses to work in a editorfortemplate of the main grid but it should work without issues. But it brakes the popup and does not load can someone help as to why please.
Basically I am wanting three fields in the inline popup name, start time,end time and duration from my activity lines model.
@model FuelActivityTrackerDal.ViewModels.ActivityEditViewModal
<
style
>
numberCircle {
border-radius: 50%;
behavior: url(PIE.htc);
/* remove if you don't care about IE8 */
width: 36px;
height: 36px;
padding: 8px;
background: #fff;
border: 2px solid #666;
color: #666;
text-align: center;
font: 60px Arial, sans-serif;
}
</
style
>
<
div
class
=
"container py-5"
>
<
div
class
=
"row"
>
<
div
class
=
"col-md-10 mx-auto"
>
<
form
>
<
div
class
=
"form-group row"
>
<
div
class
=
"col-sm-9"
>
<
label
for
=
"inputFirstname"
>Activty Name</
label
>
<
input
type
=
"text"
class
=
"form-control"
id
=
"inputFirstname"
placeholder
=
"Activity name"
>
</
div
>
</
div
>
<
div
class
=
"form-group row"
>
<
div
class
=
"col-sm-3"
>
<
label
for
=
"inputLastname"
class
=
"form-control"
>Activity Start Date</
label
>
@Html.Kendo().DateTimePickerFor(model => model.ActivityDate)
</
div
>
<
div
class
=
"col-sm-3"
>
<
label
for
=
"inputLastname"
class
=
"form-control"
>Activity End Date</
label
>
@Html.Kendo().DateTimePickerFor(model => model.ActivityEndDate)
</
div
>
</
div
>
<
div
class
=
"form-group row"
>
<
div
class
=
"col-sm-3"
>
<
label
for
=
"inputLastname"
class
=
"form-control"
>Location</
label
>
@foreach (var item in (SelectList)ViewBag.Location)
{
@Html.RadioButtonFor(model => model.OnSite, item.Value, false)
<
label
class
=
"control-label"
>@item.Text</
label
>
}
</
div
>
</
div
>
<
div
class
=
"form-group row"
>
<
div
class
=
"col-md-10"
>
<
label
for
=
"inputLastname"
class
=
"form-control"
>Description</
label
>
@Html.TextAreaFor(model => model.Description, new { @class = "whatever-class", @cols = 115, @rows = 10 })
</
div
>
</
div
>
<
div
class
=
"form-group row"
>
<
div
class
=
"col-sm-6"
>
<
label
for
=
"inputCity"
>Status </
label
>
<
select
asp-for
=
"Status"
class
=
"form-control"
asp-items
=
"@(new SelectList(@ViewBag.ProjectStatusTypes,"
LookupCode", "LookupDescription"))"></
select
>
</
div
>
<
div
class
=
"col-sm-3"
>
<
label
for
=
"inputState"
>ActivityType </
label
>
<
select
asp-for
=
"ActivityType"
class
=
"form-control"
asp-items
=
"@(new SelectList(@ViewBag.ProjectTypes,"
LookupCode", "LookupDescription"))"></
select
>
</
div
>
</
div
>
<
div
class
=
"form-group row"
>
<
div
class
=
"col-sm-6"
>
<
label
for
=
"inputCity"
>Staff </
label
>
<
select
asp-for
=
"StaffID"
class
=
"form-control"
asp-items
=
"@(new SelectList(@ViewBag.ListOfStaff,"
StaffID", "FirstName"))"></
select
>
</
div
>
<
div
class
=
"col-sm-3"
>
<
label
for
=
"inputState"
>Hours Left On Project </
label
>
<
label
for
=
"inputState"
><
div
class
=
"badge"
style
=
"font-size:18px;"
>26</
div
> </
label
>
<
label
for
=
"projecthours"
>If Porject hours fall below ten Contact Charlie.</
label
>
</
div
>
</
div
>
<
div
class
=
"form-group row"
>
@(Html.Kendo().Grid<
FuelActivityTrackerDal.Models.ActivityLines
>().Name("activityLines")
.Columns(columns =>
{
columns.Bound(p => p.Description).Filterable(false);
columns.Bound(p => p.StaffMemeber).Filterable(false);
columns.Bound(p => p.StartTime).Filterable(false);
columns.Bound(p => p.EndTime).Filterable(false);
columns.Bound(p => p.Status);
columns.Command(command => command.Custom("ViewDetails").Click("showDetails"));
})
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.ActivityLineId))
.Read(read => read.Action("ActivityLines_Read", "Activity"))
))
</
div
>
<
div
class
=
"form-group row"
>
<
div
class
=
"col-sm-6"
>
</
div
>
</
div
>
<
button
type
=
"button"
class
=
"btn btn-primary px-4 float-right"
>Add Work Item</
button
>
<
button
type
=
"button"
class
=
"btn btn-primary px-4 float-right"
>Put Case & Client On Hold</
button
>
<
button
type
=
"button"
class
=
"btn btn-primary px-4"
>Cancel</
button
>
</
form
>
</
div
>
</
div
>
<
script
type
=
"text/x-kendo-template"
id
=
"template"
>
<
div
id
=
"details-container"
>
<
h2
>#= FirstName # #= LastName #</
h2
>
<
em
>#= Title #</
em
>
<
dl
>
<
dt
>City: #= City #</
dt
>
<
dt
>Address: #= Address #</
dt
>
</
dl
>
</
div
>
</
script
>
<
script
type
=
"text/javascript"
>
var detailsTemplate = kendo.template($("#template").html());
function showDetails(e) {
e.preventDefault();
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var wnd = $("#Details").data("kendoWindow");
wnd.content(detailsTemplate(dataItem));
wnd.center().open();
}
</
script
>
@*<
div
class
=
"k-edit-form-container"
>
<
h3
>Activity</
h3
>
<
br
/>
@Html.HiddenFor(model => model.Name)
<
div
class
=
"k-edit-label"
>
@Html.LabelFor(model => model.Name)
</
div
>
<
div
class
=
"k-edit-label"
>
@Html.LabelFor(model => model.Description)
</
div
>
<
div
class
=
"k-edit-field"
>
</
div
>
<
div
class
=
"k-edit-label"
>
@Html.LabelFor(model => model.HoursLeftOnProject)
</
div
>
<
div
class
=
"k-edit-field"
>
@Html.Kendo().IntegerTextBoxFor(model => model.HoursLeftOnProject)
</
div
>
<
div
class
=
"k-edit-label"
>
@Html.LabelFor(model => model.ActivityDate)
</
div
>
<
div
class
=
"k-edit-field"
>
@Html.Kendo().DateTimePickerFor(model => model.ActivityDate)
</
div
>*@
</
div
>