When no datasource is bound, the slot titles and resource group names are not shown, despite being known. After binding to a datasource, they get set immediately. This leads to a glitchy user experience, as there is an empty table with no text whatsoever, as long no databinding is triggeredThe resource descriptions and slot header texts should be set independently from the data binding. The behavior can be observed in the attached example.
Regards, Frieder
Hi Frieder,
In this case, I am leaving this request open to our community interest because you have a point that when the columnWidth property is set, it should work even when there is empty data:
https://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler/configuration/views.columnwidth
Regards,
Eyup
Progress Telerik
Hello Eyup,
that sure is the way it is implemented, but in the given example every information needed to render an empty table with resource names is present as the resources are bound to a ViewData property, which is available before the scheduler is even iinitialised.
...
.Resources(resource =>
{
resource.Add(m => m.Area)
.Title("Area")
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
.BindTo((System.Collections.IEnumerable)ViewData["resources"]);
})
....
Also, the colum width is defined in the custom view, so columns could be rendered in the desired width without the need to bind to to any data.
var timelineYear = kendo.ui.TimelineMonthView.extend({
options: {
name: "timelineYear",
title: "Jahr",
selectedDateFormat: "{0:D} - {1:D}",
selectedShortDateFormat: "{0:d} - {1:d}",
majorTick: 1440,
columnWidth: 110
...
So maybe this is a feature request,but i don't see any reason aside from the existing implementation that would make the desired behavoir impossible.
Regards, Frieder
Hello Frieder,
Thank you for writing to us. I hope you are doing well.
This behavior happens because the Resource values of the Scheduler are still not known without it getting bound. You see, when the .AutoBind() property of the Scheduler is disabled and set to false, this is also being applied for the underlying .Resources() collection:
"If set to false
the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the
data source is fired. That will also apply for data sources for the resources used in the widget."
As described here:
https://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler/configuration/autobind
This means that the Scheduler table knows about these field names even without binding:
.Title("Area")
.DataTextField("Text")
.DataValueField("Value")
.DataColorField("Color")
Therefore, the table cannot calculate its cell size accurately and shows a bunch of smashed cells for the entire year (without horizontal scroll bar):
I hope this explanation makes sense. If you want to change this appearance to have a more pleasant visualization, you can include this CSS rule:
<style>
.k-scheduler-layout {
overflow: scroll;
display: block;
}
.k-slot-cell {
width: 166px;
}
</style>
I hope this info will prove helpful. Do not hesitate to let me know if I
made a mistake somewhere or
you need
more particular and specific example/code. I will be ready to help you
with any other inquires you might have.
Regards,
Eyup
Progress Telerik