We have a Asp.net core 6 application and we are trying to use the kendo-scheduler to display data in a month view.
I am following the "Basic Usage" example.
My calendar renders but there are no events displaying. And there are no errors.
My controller is getting called and it is passing back a list of events based on my model below.
I'm also trying to use an event-template. But this doesn't displaying anything in the calendar.
My ultimate goal would be to display a kendo-chart in each day of a month using the template.
But for now I'd like to get something like the below to work.
//This is my model:
public class TaskViewModel : ISchedulerEvent
{
public int TaskID { get; set; }
public string Title { get; set; }
public string Description { get; set; }
private DateTime start;
private DateTime end;
public bool IsAllDay { get; set; }
public int? OwnerID { get; set; }
}
//My controller:
public virtual JsonResult Basic_Usage_Read([DataSourceRequest] DataSourceRequest request)
{
List<TaskViewModel> list = GetItems();
return Json(list);
}
//Here is my Index.cshtml:
@{
var resources = new[]
{
new { Text = "Alex", Value = 1, Color = "#f8a398" } ,
new { Text = "Bob", Value = 2, Color = "#51a0ed" } ,
new { Text = "Charlie", Value = 3, Color = "#56ca85" }
};
string defaultTitle = "No Title";
}
<script id="event-template" type="text/x-kendo-template">
<div class="template-container">
<h3>Hello World #: Title # </h3>
</div>
</script>
<kendo-scheduler name="scheduler"
date="new DateTime(2022, 10, 01)"
start-time="new DateTime(2022, 10, 01, 7, 00, 00)"
height="600"
event-template-id="event-template"
timezone="Etc/UTC">
<views>
<view type="month"></view>
</views>
<resources>
<resource field="OwnerID" title="Owner" datatextfield="Text" datavaluefield="Value" datacolorfield="Color" bind-to="@resources">
</resource>
</resources>
<schema data="Data" total="Total" errors="Errors">
<scheduler-model id="TaskID">
<fields>
<field name="TaskID" type="number"></field>
<field name="title" from="Title" type="string" default-value="@defaultTitle"></field>
<field name="start" from="Start" type="date"></field>
<field name="end" from="End" type="date"></field>
<field name="description" from="Description" type="string"></field>
<field name="OwnerID" type="number" default-value="1"></field>
<field name="isAllDay" from="IsAllDay" type="boolean"></field>
</fields>
</scheduler-model>
</schema>
</scheduler-datasource>
</kendo-scheduler>