Hello,
I'm using the scheduler in timeline month view (albeit with a custom view to just show 7 days) and I want to freeze the top row.
Here is my grid:
@(Html.Kendo().Scheduler<TEAMSV2.Models.WeekViewSchedulerDTO>() .Name(Section + TabName + SubTabName) .Date(new DateTime(ChosenDate.Year, ChosenDate.Month, ChosenDate.Day)) .StartTime(new DateTime(ChosenDate.Year, ChosenDate.Month, ChosenDate.Day, 00, 00, 00)) .EndTime(new DateTime(ChosenDate.Year, ChosenDate.Month, ChosenDate.Day, 23, 59, 59)) .Timezone("Etc/UTC") .MajorTick(1440) .Height(500) .Views(v => { v.CustomView("MyCustomTimelistView"); }) .Group(group => group.Resources("Employees").Orientation(SchedulerGroupOrientation.Vertical)) .Resources(r => { r.Add(m => m.Employees) .Title("Employees") .Name("Employees") .Multiple(true) .DataTextField("Text") .DataValueField("Value") //.DataColorField("Color") .DataSource(d => d .Read(rd => { rd.Action("GetWeekViewResources", "TeamsV2").Type(HttpVerbs.Post); }) ); }) .DataSource(d => d .Model(m => { m.Id(f => f.EventId); m.Field(f => f.Title).DefaultValue("No title"); }) .Read("GetWeekViewSchedulerData", "TeamsV2") ) .Events(e => e .DataBinding(Section + TabName + SubTabName + "SchedulerDatabinding") .DataBound(Section + TabName + SubTabName + "SchedulerDatabound") ))
And here is the custom view:
<script> var MyCustomTimelistView = kendo.ui.TimelineMonthView.extend({ options: { name: "MyCustomTimelistView", title: "Timeline Month", selectedDateFormat: "{0:D} - {1:D}", selectedShortDateFormat: "{0:d} - {1:d}", majorTick: 720, numberOfDays: 7, dateHeaderTemplate: "<div class='k-link k-nav-day'>#=kendo.toString(date, 'ddd dd MMM yyyy')#</div>" }, name: "MyCustomTimelistView", calculateDateRange: function () { //create the required number of days var start = this.options.date, // start = kendo.date.dayOfWeek(selectedDate, this.calendarInfo().firstDay, -1), idx, length, dates = []; for (idx = 0, length = this.options.numberOfDays; idx < length; idx++) { dates.push(start); start = kendo.date.nextDay(start); } this._render(dates); }, previousDate: function () { var date = new Date(this.startDate()); date.setDate(date.getDate() - this.options.numberOfDays); return date } });</script>
The "Resources" for this scheduler are a list of employees but the top one is hard-coded as "Unassigned" for when an event is not assigned to an employee. I need this row of unassigned events to always be visible when the rest of the employees are scrolled (as the scheduler is set to 500px).
Any ideas?
Thanks,
Mark.
