我们需要根据特定日期的其他事件来操纵事件渲染。因此,是否可以根据我们的事件数据中的条件合并所有事件或仅在特定的一天中合并所有事件或仅在特定日期使用第一个事件或仅使用第二事件(意味着合并所有事件或所有事件或排除第一赛事&包括第二次活动,或包括第1个活动并排除第二活动)。我们看上去像一天的渲染,但回调具有该日期的事件数据。
请参阅下面的重复行为描述的示例事件
[{
"title": "Recurring on all days",
"dow": [0, 1, 2, 3, 4, 5, 6 ],
"ranges": {
"start": "2017-09-18",
"end": "2017-09-25"
},
"recurringBehaviourType": 1,
"recurringBehaviour": "Merge this event with future conflicting events. This is working fine=> oe. this #event1 merges with #event2.",
"color": "Blue",
"start": "08:00",
"end": "17:00"
},
{
"title": "Non Recurring [Day Schedule]",
"ranges": {
"start": "2017-09-23",
"end": "2017-09-23"
},
"color": "Red",
"start": "08:00",
"end": "17:00"
},
{
"title": "Recurring on all days",
"dow": [0, 1, 2, 3, 4, 5, 6 ],
"recurringBehaviourType": 2,
"recurringBehaviour": "Use this event instead of future conflicting events. ie. #event4 no need to merge with this #event3. Here need to ignore #event4.",
"ranges": {
"start": "2017-09-01",
"end": "2017-09-08"
},
"color": "Blue",
"start": "08:00",
"end": "17:00"
},
{
"title": "Non Recurring [Day Schedule]",
"ranges": {
"start": "2017-09-06",
"end": "2017-09-06"
},
"color": "Red",
"start": "08:00",
"end": "17:00"
},
{
"title": "Recurring on all days",
"dow": [0, 1, 2, 3, 4, 5, 6 ],
"ranges": {
"start": "2017-09-10",
"end": "2017-09-16"
},
"recurringBehaviourType": 3,
"recurringBehaviour": "Use future conflicting events instead of this eventie. ie. This #event5 no need to merge with #event6. Here need to ignore this #event5.",
"color": "Blue",
"start": "08:00",
"end": "17:00"
},
{
"title": "Non Recurring [Day Schedule]",
"ranges": {
"start": "2017-09-12",
"end": "2017-09-12"
},
"color": "Red",
"start": "08:00",
"end": "17:00"
},
]
我们很高兴知道是否有解决此要求的解决方案。
您可以使用eventRender()
回调将CSS类或数据属性添加到事件中,包括CSS,如果您不想显示它们。
然后,一旦将所有事件与您的类/数据属性一起渲染,您可以使用eventAfterAllRender()
回调来查找并使用这些类/数据属性检查它们。然后,您可以更新事件的CSS,或添加并显示新元素。
这是工作JS的一个示例,仅显示任何给定一天的事件总数,而不是实际事件的总数。它应该让您入门。