javascript - fullcalendar 在超过 10k 个事件后停止显示事件
问题描述
嗨,我想将 fullcalendar 与数据库一起使用,但一旦我在日历中放入超过 10k 的事件,它就会停止显示事件。有没有办法阻止 fullcalendar 停止显示事件?
下面的版本是 4.0.0
(我用了 3.9.0 和 4.0.0 的 fullcalendar 都不起作用)
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () { // DOMContentLoaded zorgt ervoor dat eerst de html laad
var calendarEl = document.getElementById('calendar'); // grab element reference
var calendar = new FullCalendar.Calendar(calendarEl, {
// put your options and callbacks here
events: [
<?php
include_once('./assets/handlers/DB_Handler.php');
try {
$getCalenderItems = $conn->prepare("SELECT COD.CursusID, O.Onderdeelnaam,
CONCAT( REPLACE( DATE_ADD( DATE( CO.DatumBegin ) , INTERVAL -1 MONTH ) , '-', ',' ) , ',', HOUR( CO.DatumBegin ) , ',', MINUTE( CO.DatumBegin ) ) AS Start,
CONCAT( REPLACE( DATE_ADD( DATE( CO.DatumEind ) , INTERVAL -1 MONTH ) , '-', ',' ) , ',', HOUR( CO.DatumEind ) , ',', MINUTE( CO.DatumEind ) ) AS Eind
FROM cursusonderdeeldocenten COD
INNER JOIN onderdelen O ON COD.OnderdeelID = O.OnderdeelID
INNER JOIN cursusonderdelen CO ON COD.CursusID = CO.CursusID
WHERE COD.DocentID = 15
AND CO.DatumBegin >= DATE_ADD(CURDATE(), INTERVAL -8 MONTH)
ORDER BY CO.DatumBegin");
$getCalenderItems->bindParam(':DocentID', $DiD);
// Select docent
$DiD = 15;
$getCalenderItems->execute();
$count = $getCalenderItems->rowCount();
} catch (PDOException $e) {
$e->getMessage();
}
$i = 0;
while ($row = $getCalenderItems->fetch()) {
echo '
{
title: "' . $row['Onderdeelnaam'] . '",
start: new Date(' . $row['Start'] . '),
end: new Date(' . $row['Eind'] . '),
url: "./beoordelen/' . $row['CursusID'] . '"
}';
if ($i >= $count) {
echo "";
} else {
echo ",";
}
$i++;
}
?>
]
});
calendar.render();
});
</script>
<div id='calendar'></div>
</div>
解决方案
推荐阅读
- java - Weblogic 控制台获取任何用户的当前密码
- c# - 从 servicenow 公开的 SOAP 的 NULL 响应以获取事件编号详细信息?
- git - 由于冲突解决不当,将分支重新合并到主分支
- javascript - 如何在 google 和 API 的操作中使用 async 和 await
- pyspark - IllegalArgumentException:'字段“标签”不存在。在 PYSPARK
- django - 我有 django rest_framework ListAPIView 方法,它返回用户列表,我如何从同一个用户列表中排除请求用户
- orchardcms - 覆盖 Orchard 中的密码格式
- polymer - Polymer 3 - KeyframeEffect 未定义
- ios - 渐变 UIButton 的边框与圆角半径
- sql - 从聚集复合键移动到顺序整数聚集键时性能损失