资源时间轴:事件函数仅在按下上一个或下一个按钮时调用,但在时间轴滚动时不调用

问题描述

我将 FullCalendar React 组件与资源时间线视图一起使用。我的目标是仅获取用户实际能够看到的区域的事件。由于我的 API 的结构,我无法提供 JSON 提要。所以根据文档,有事件作为函数。我开始为这种方法实现一个解决方案,但问题是,只有在我实际按下下一个或上一个按钮时才会调用函数,但在我滚动时间轴时不会调用函数,但这正是我真正需要的。这可以通过 Fullcalendar 实现吗?为了让您尽可能轻松地重现此行为,这里是我实现的组件:

import FullCalendar from '@fullcalendar/react'
import resourceTimelinePlugin from '@fullcalendar/resource-timeline';

function App() {
  return (
    <FullCalendar
        plugins={[ resourceTimelinePlugin ]}
        initialView="resourceTimelineYear"
        schedulerLicenseKey = "CC-Attribution-NonCommercial-NoDerivatives"
        resources={
          [
            {id: "a",title: "Room A"},{id: "b",title: "Room B"},{id: 'c',title: 'Room C'}
          ]
        }
        events={
          function(fetchInfo,successCallback,failureCallback) {
            console.log("Call!"); /* only called when prev. or next button is 
            pressed but not when scrolling through the timeline */
          }
        }
        height={650}
      />
  );
}

export default App;

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)