SchedulerMonthViewBuilder
Methods
DayTemplate(System.String)
Defines the template used to render the day slots in the month view. The available fields in the template are: - date: Represents the current date. - resources(): Returns the relevant resources for the current slot.
Parameters
dayTemplate - System.String
The value that configures the template content.
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(views =>
{
views.MonthView(w => w.DayTemplate("<strong>#= kendo.toString(date, 'ddd') #</strong>"));
})
)
DayTemplateId(System.String)
Defines the template used to render the day slots in the month view. The available fields in the template are: - date: Represents the current date. - resources(): Returns the relevant resources for the current slot.
Parameters
dayTemplateId - System.String
The "id" attribute of the external Kendo UI Template.
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(views =>
{
views.MonthView(w => w.DayTemplateId("dayTemplate"));
})
)
<script id="dayTemplate" type="text/x-kendo-template">
<strong>#= kendo.toString(date, 'ddd') #</strong>
</script>
DayTemplateView(System.Web.Mvc.MvcHtmlString)
Defines the template used to render the day slots in the month view. The available fields in the template are: - date: Represents the current date. - resources(): Returns the relevant resources for the current slot.
Parameters
dayTemplate - System.Web.Mvc.MvcHtmlString
The Razor View that contains the template.
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(views =>
{
views.MonthView(w => w.DayTemplateView(Html.Partial("DayTemplateView")));
})
)
DayTemplateHandler(System.String)
Defines the template used to render the day slots in the month view. The available fields in the template are: - date: Represents the current date. - resources(): Returns the relevant resources for the current slot.
Parameters
dayTemplate - System.String
The JavaScript function that returns the template.
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(views =>
{
views.MonthView(w => w.DayTemplateHandler("getDayTemplate"));
})
)
<script>
function getDayTemplate(data) {
return `<strong>${kendo.toString(data.date, 'ddd')}</strong>`;
}
</script>
DayTemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)
Defines the template used to render the day slots in the month view. The available fields in the template are: - date: Represents the current date. - resources(): Returns the relevant resources for the current slot.
Parameters
template - TemplateBuilder<TModel>
A Template component that configures the template.
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(views =>
{
views.MonthView(w => w.DayTemplate(Html.Kendo().Template().AddHtml("<strong>${kendo.toString(data.date, 'ddd')}</strong>")));
})
)
EventHeight(System.Object)
The height of the scheduler event rendered in month and timeline views. In month view it could be set to a concrete number or to the string value "auto". When set to "auto" it will automatically set the views.adaptiveRowHeight property to true.
Parameters
eventHeight - System.Object
The eventHeight
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(v=>
{
v.MonthView(m => m.EventHeight(new {}));
})
)
EventSpacing(System.Nullable)
Specifies the distance between individual events.
Parameters
eventSpacing - System.Nullable<Double>
The eventSpacing
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(v=>
{
v.MonthView(m => m.EventSpacing(2));
})
)
EventsPerDay(System.Nullable)
Indicates how many events could be listed for a day. When there are more events for a specific day a "more" link will be placed at the bottom of the day slot and will navigate to the day view if clicked.
Parameters
eventsPerDay - System.Nullable<Double>
The eventsPerDay
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(v=>
{
v.MonthView(m => m.EventsPerDay(2));
})
)
AdaptiveSlotHeight(System.Boolean)
Increases the slot height when containing events up to views.eventsPerDay and reduces its height if there are less events for that specific day.
Parameters
adaptiveSlotHeight - System.Boolean
The adaptiveSlotHeight
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(v=>
{
v.MonthView(m => m.AdaptiveSlotHeight(true));
})
)
Virtual(System.Boolean)
Enables the DOM virtualization for vertical grouping of the view - renders batches of DOM elements as you scroll. The views that support this option are: "day", "week", "workWeek", "month".
Parameters
enable - System.Boolean
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(v=>
{
v.MonthView(m => m.Virtual(true));
})
)
Title(System.String)
The user-friendly title of the view displayed by the scheduler.
Parameters
title - System.String
The title
Example
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.Task>()
.Name("scheduler")
.Date(new DateTime(2013, 6, 13))
.Views(views =>
{
views.DayView(dayView => {
dayView.Title("Day");
});
})
.DataSource(d => d
.Model(m => m.Id(f => f.TaskID))
.Read("Read", "Scheduler")
.Create("Create", "Scheduler")
.Destroy("Destroy", "Scheduler")
.Update("Update", "Scheduler")
)
)
Editable(System.Action)
Sets the editing configuration of the current scheduler view.
Parameters
configurator - System.Action<SchedulerViewEditableSettingsBuilder>
The lambda which configures the editing
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Editable(e=>e.Confirmation(true))
)
Editable(System.Boolean)
If set to true the user would be able to create new scheduler events and modify or delete existing ones. Default value is true.
Parameters
isEditable - System.Boolean
The isEditable
Example
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.Task>()
.Name("scheduler")
.Date(new DateTime(2013, 6, 13))
.Views(views =>
{
views.DayView(dayView => {
dayView.Title("Day");
dayView.Editable(false);
});
views.AgendaView();
})
.DataSource(d => d
.Model(m => m.Id(f => f.TaskID))
.Read("Read", "Scheduler")
.Create("Create", "Scheduler")
.Destroy("Destroy", "Scheduler")
.Update("Update", "Scheduler")
)
)
EventTemplate(System.String)
Defines the template used by the view to render the Scheduler events. The available fields in the template are: - description: The event description. - end: The event end date. - resources: The event resources. - start: The event start date. - title: The event title.
Parameters
eventTemplate - System.String
The value that configures the template content.
Example
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.Screening>()
.Name("scheduler")
.Views(views =>
{
views.DayView(dayView => dayView.EventTemplate("<div>Title: #: title #</div>"));
})
)
EventTemplateId(System.String)
Defines the template used by the view to render the Scheduler events. The available fields in the template are: - description: The event description. - end: The event end date. - resources: The event resources. - start: The event start date. - title: The event title.
Parameters
eventTemplateId - System.String
The "id" attribute of the external Kendo UI Template.
Example
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.Screening>()
.Name("scheduler")
.Views(views =>
{
views.DayView(dayView => dayView.EventTemplateId("eventTemplate"));
})
)
<script id="eventTemplate" type="text/x-kendo-template">
<div>Title: #: title #</div>
</script>
EventTemplateView(System.Web.Mvc.MvcHtmlString)
Defines the template used by the view to render the Scheduler events. The available fields in the template are: - description: The event description. - end: The event end date. - resources: The event resources. - start: The event start date. - title: The event title.
Parameters
eventTemplate - System.Web.Mvc.MvcHtmlString
The Razor View that contains the template.
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(views =>
{
views.DayView(dayView => dayView.EventTemplateView(Html.Partial("EventTemplateView")));
})
)
EventTemplateHandler(System.String)
Defines the template used by the view to render the Scheduler events. The available fields in the template are: - description: The event description. - end: The event end date. - resources: The event resources. - start: The event start date. - title: The event title.
Parameters
eventTemplate - System.String
The JavaScript function that returns the template.
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(views =>
{
views.DayView(dayView => dayView.EventTemplateHandler("getEventTemplate"));
})
)
<script>
function getEventTemplate(data) {
return `<div>Title: ${data.title} </div>`;
}
</script>
EventTemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)
Defines the template used by the view to render the Scheduler events. The available fields in the template are: - description: The event description. - end: The event end date. - resources: The event resources. - start: The event start date. - title: The event title.
Parameters
template - TemplateBuilder<TModel>
A Template component that configures the template.
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(views =>
{
views.DayView(dayView => dayView.EventTemplate(Html.Kendo().Template().AddHtml("<div>Title: ${data.title}</div>")));
})
)
SelectedDateFormat(System.String)
The format used to display the selected date. Uses kendo.format. Contains two placeholders - "{0}" and "{1}" which represent the start and end date displayed by the view.
Parameters
selectedDateFormat - System.String
The selectedDateFormat.
Example
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.Task>()
.Name("scheduler")
.Date(new DateTime(2013, 6, 13))
.Views(views =>
{
views.DayView(dayView => {
dayView.Title("Day");
dayView.Editable(false);
dayView.SelectedDateFormat("{0:dd-MM-yyyy}");
});
views.AgendaView();
})
.DataSource(d => d
.Model(m => m.Id(f => f.TaskID))
.Read("Read", "Scheduler")
.Create("Create", "Scheduler")
.Destroy("Destroy", "Scheduler")
.Update("Update", "Scheduler")
)
)
SelectedShortDateFormat(System.String)
The format used to display the selected short date. Uses kendo.format. Contains two placeholders - "{0}" and "{1}" which represent the start and end date displayed by the view.
Parameters
selectedShortDateFormat - System.String
The selectedShortDateFormat.
Example
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.Task>()
.Name("scheduler")
.Date(new DateTime(2013, 6, 13))
.Views(views =>
{
views.DayView(dayView => {
dayView.Title("Day");
dayView.Editable(false);
dayView.SelectedShortDateFormat("{0:dd-MM-yyyy}");
});
views.AgendaView();
})
.DataSource(d => d
.Model(m => m.Id(f => f.TaskID))
.Read("Read", "Scheduler")
.Create("Create", "Scheduler")
.Destroy("Destroy", "Scheduler")
.Update("Update", "Scheduler")
)
)
Selected(System.Boolean)
If set to true the view will be initially selected by the scheduler widget. Default value is false.
Parameters
isSelected - System.Boolean
The isSelected
Example
@(Html.Kendo().Scheduler<Kendo.Mvc.Examples.Models.Scheduler.Task>()
.Name("scheduler")
.Date(new DateTime(2013, 6, 13))
.Views(views =>
{
views.DayView(dayView => {
dayView.Title("Day");
dayView.Editable(false);
dayView.SelectedDateFormat("{0:dd-MM-yyyy}");
dayView.Selected(true);
});
views.AgendaView();
})
.DataSource(d => d
.Model(m => m.Id(f => f.TaskID))
.Read("Read", "Scheduler")
.Create("Create", "Scheduler")
.Destroy("Destroy", "Scheduler")
.Update("Update", "Scheduler")
)
)
Groups(Kendo.Mvc.UI.SchedulerGroupOrientation)
Sets the orientation of the group headers
Parameters
orientation - SchedulerGroupOrientation
The orientation
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(v=> { v.TimelineMonthView(t => t.Groups(SchedulerGroupOrientation.Default)); })
)
Groups(System.Boolean)
Sets grouping by date.
Parameters
date - System.Boolean
The grouping by date
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(v=> { v.TimelineMonthView(t => t.Groups(true)); })
)
Groups(System.Action)
Sets the resources grouping configuration of the view.
Parameters
configuration - System.Action<SchedulerGroupBuilder>
The lambda which configures the view grouping
Example
@(Html.Kendo().Scheduler<Activity>()
.Name("scheduler")
.Views(v=> { v.TimelineMonthView(t => t.Groups(x=>x.Date(true))); })
)