简体   繁体   English

如何使用 typescript 在更改视图(如日视图或周视图)上获取剑道调度程序的当前视图?

[英]How can i get kendo scheduler current view on change view like day view or week view using typescript?

<kendo-scheduler [kendoSchedulerBinding]="events"
                 [selectedDate]="selectedDate"
                 [group]="group" [resources]="resources"
                 style="height: 600px;"
                 [workDayStart]="workDayStart" [workDayEnd]="workDayEnd" [showWorkHours]="true" (dateChange)="onDateChange($event)">
    <ng-template kendoSchedulerGroupHeaderTemplate let-resource="resource">
        <span [style.color]="resource?.color"><a  id="{{resource.text|split:'*':0}}" href="javascript:void(0);" class="user-unavilability">{{resource.text|split:'*':1}}</a></span>
    </ng-template>

    <kendo-scheduler-day-view>
    </kendo-scheduler-day-view>
    <kendo-scheduler-week-view>
    </kendo-scheduler-week-view>

</kendo-scheduler>

I have to get the current view of this kendo-scheduler (eg. day-view or week-view) in typescript and which view is by default selected in kendo-scheduler.我必须在 typescript 中获取此剑道调度程序的当前视图(例如日视图或周视图),并且默认情况下在剑道调度程序中选择哪个视图。

In your example the index of the views is in the order of defining the views.在您的示例中,视图的索引按定义视图的顺序排列。 So day-view is index 0, week-view is 1. Default is the first one.所以日视图是索引 0,周视图是 1。默认是第一个。 To set a different default you can use要设置不同的默认值,您可以使用

 <kendo-scheduler [selectedViewIndex]="1" ...

to set the default to index 1. With that you can also use a variable to set the view index.将默认值设置为索引 1。这样,您还可以使用变量来设置视图索引。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM