Hello Telerik Team,
How can I set scheduler title date range to the current week (dynamic)? How to set the Agenda view to default view whenever the calendar load? How to make the text with all day schedule to hyper link (however, this text is linkable in agenda view)?
This is the code:
@(Html.Kendo().Scheduler<HomeTaskViewModel>()
.Name("scheduler")
.Date(new DateTime(2018, 5, 7))
.StartTime(new DateTime(2018, 5, 7, 0, 00, 00))
.EndTime(new DateTime(2018, 5, 7, 23, 59, 59))
.Editable(false)
.Height(600)
.EventTemplate(
"<div class='task-template'>" +
//"#= kendo.toString(start, 'hh:mm') # - #= kendo.toString(end, 'hh:mm') #" +
//"<br />" +
//"<a href='#= Url #'>#= description #</a>" +
"<a href='" + @Url.Action("Read","Request") + "/" + "#= RequestId #'>#= description #</a>" +
"</div>")
.Views(views =>
{
views.DayView();
views.WorkWeekView(workWeekView => workWeekView.Selected(true));
views.WeekView();
views.MonthView();
views.AgendaView();
//views.TimelineView();
})
.Resources(resource =>
{
resource.Add(m => m.GroupId)
.Title("Owner")
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
.BindTo(Model.Select(x => new {Text = x.GroupName, Value = x.GroupId, Color = x.Color}));
})
//.BindTo(Model)
.DataSource(d => d
.Model(m => {
m.Id(f => f.RequestId);
m.Field(f => f.Description).DefaultValue("No title");
m.Field(f => f.GroupId).DefaultValue(1);
m.Field(f => f.Title).DefaultValue("No title");
m.RecurrenceId(f => f.RecurrenceID);
})
.Read("ReadRequests", "Home", "Scheduler")
)
)
<script type="text/javascript">
$(function () {
$(".GroupNames :checkbox").change(function (e) {
var checked = $.map($(".GroupNames :checked"), function (checkbox) {
return parseInt($(checkbox).val());
});
var filter = {
logic: "or",
filters: $.map(checked, function (value) {
return {
operator: "eq",
field: "GroupId",
value: value
};
})
};
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.dataSource.filter(filter);
});
})
</script>
Thank you very much in advanced for your help!
Anieda