我正在尝试开发功能,如果它们在调度程序中的特定单元格内的同一时间范围内超过 2 个事件,它将完全阻止单元格。问题是我不确定如何计算某个时间范围内的单元格中是否有 2 个或更多事件。
我有大量代码,所以我只会显示与问题相关的部分。我不确定我可以将哪些事件放入调度程序以检查单元格内的事件长度。
我一直引用的链接是那里的文档:
https://ej2.syncfusion.com/react/demos/#/material/schedule/events
我的代码:
<ScheduleComponent
width="100%"
height="650px"
minDate={previousDay}
showTimeIndicator={false}
currentView="Week"
startHour="9:00"
endHour="20:30"
workHours={{ highlight: false }}
ref={(schedule) => (this.scheduleObj = schedule)}
eventSettings={{
dataSource: this.dataManager,
fields: this.fields,
}}
cellDoubleClick={this.cellDoubleClick.bind(this)}
actionBegin={this.actionBegin.bind(this)}
eventRendered={this.onEventRendered.bind(this)}
timeScale={{
enable: true,
interval: 30,
slotCount: 1,
}}
popupOpen={this.popupOpen.bind(this)}
quickInfoTemplates={{
header: this.headerTemplate.bind(this),
content: this.editorTemplate.bind(this),
footer: this.footerTemplate.bind(this),
}}
>
<ViewsDirective>
<ViewDirective option="Day" />
<ViewDirective option="Week" />
</ViewsDirective>
<Inject services={[TimelineViews, Day, Week, Resize]} />
</ScheduleComponent>