我将完整的日历设置为显示在选项卡上。加载页面时,根据事件的开始和结束日期,我想设置日历的默认视图。但在创建完整日历后,事件未定义。该事件是通过 ajax 调用加载的,但此时未调用该函数。
谢谢!
here is how the page looks :
<div class="main-container"> here are inputs, datepickers<div>
<div class="tabs-container">
<div class="tab1">some info(when load page it is the tab displayed)</div>
<div class="tab2">schedule(it's hide when load page)</div>
</div>
通过主容器中的输入和日期选择器(开始日期时间,结束日期时间),我在时间表上显示/更新,因此可以通过主容器中的控件添加新事件或编辑事件。
$(document).ready(function () {
var caloption = $("#calendar")
.fullCalendar({
groupByDateAndResource: true,
resources: getScheduleResources,
events: getScheduleEvents
});
caloption.option.defaultView = //method try to get event start time and end time in order to see the difference between days eg. if there is a difference of 6 days the defaultView should be timelineWeek
$("#calendar").fullCalendar(caleoption);
但是该事件是未定义的,因为在加载页面或直到不显示选项卡(即单击包含计划的选项卡)获取事件,资源它没有完成。