Hi Telerik.
I am trying to accomplish a scheduler with horizontal grouping of several resources, say mechanics.
So, I have a day view scheduler with a variable number of mechanics as resources on top, comparable to selecting the day view in this demo. Now, I have included the following code:
However, using the above code all mechanics obviously have exactly the same working hours, that is, from 8:00 to 17:00.
Imagine that I have two mechanics, say A and B, and that mechanic A usually works from 8:00 to 17:00 and mechanic B from 9:00 to 18:00.
How can I easily achieve this as the number of mechanics is variable and a mechanic's working hours is extracted from the database for a specific date?
What I would like to accomplish is to add the css class k-nonwork-hour to a resource's (mechanic) unavailable hours. I have an idea of how to obtain the desired result with javascript, but this approach is quite extensive and its code is complex to write and maintain. I wonder whether there's an easier way to achieve this.
I have already resolved this server-side so that you cannot drag and drop an event into a mechanic's unavailable hours, but I would like to show this unavailability visually in the scheduler itself as well.
I am looking forward to hearing from you soon. Thanks in advance!
Kind regards,
Mor
I am trying to accomplish a scheduler with horizontal grouping of several resources, say mechanics.
So, I have a day view scheduler with a variable number of mechanics as resources on top, comparable to selecting the day view in this demo. Now, I have included the following code:
@(Html.Kendo().Scheduler<VisitViewModel>()
.Name(
"scheduler"
)
.Date(DateTime.Now)
.StartTime(7, 0, 0)
.EndTime(18, 0, 0)
.Timezone(
"Etc/UTC"
)
.AllDaySlot(
false
)
.Views(views => {
views.DayView(view => view.Selected(
true
)
.WorkDayStart(8, 0, 0)
.WorkDayEnd(17, 0, 0)
.SelectedDateFormat(
"{0:dddd d/M/yyyy}"
));
})
.Resources(resource => resource
.Add(m => m.MechanicId)
.Title(
"Mechanic"
)
.Name(
"mechanic"
)
.Multiple(
false
)
.DataTextField(
"Text"
)
.DataValueField(
"Value"
)
.BindTo(GetMechanics().Select(v =>
new
{ Text = String.Format(
"{0} {1}"
, v.FirstName, v.LastName), Value = v.Id }).ToArray()))
However, using the above code all mechanics obviously have exactly the same working hours, that is, from 8:00 to 17:00.
Imagine that I have two mechanics, say A and B, and that mechanic A usually works from 8:00 to 17:00 and mechanic B from 9:00 to 18:00.
How can I easily achieve this as the number of mechanics is variable and a mechanic's working hours is extracted from the database for a specific date?
What I would like to accomplish is to add the css class k-nonwork-hour to a resource's (mechanic) unavailable hours. I have an idea of how to obtain the desired result with javascript, but this approach is quite extensive and its code is complex to write and maintain. I wonder whether there's an easier way to achieve this.
I have already resolved this server-side so that you cannot drag and drop an event into a mechanic's unavailable hours, but I would like to show this unavailability visually in the scheduler itself as well.
I am looking forward to hearing from you soon. Thanks in advance!
Kind regards,
Mor