跳转到主要内容

setLoadMode

Description

设置分段加载数据的模式,实现动态加载

setLoadMode: (mode: string) => void

Parameters

  • mode - (required) string - 加载模式

Example

scheduler.config.load_date = "%Y.%m.%d";  
scheduler.init('scheduler_here',new Date(2009,10,1),"month");

scheduler.setLoadMode("month")
scheduler.load("data/events.php");

Details

注释

此方法应在调用 scheduler.init() 之后,但在加载任何数据到scheduler之前使用。

默认情况下,scheduler 会一次性加载所有数据。当处理大量事件集合时,这种方式效率较低。在这种情况下,最好按段加载数据,仅加载当前视图所需的数据。

mode 参数可接受以下预定义值之一:

  • day;
  • week;
  • month;
  • year。

例如,将模式设置为 'month' 会使 scheduler 仅请求当前月份的数据,并根据需要加载更多数据。 了解更多关于加载模式的信息

请求

生成的请求格式如下:

Data?from=DATEHERE&to=DATEHERE

其中 DATEHERE 是根据 load_date 设置格式化的有效日期。


当服务器端使用 dhtmlxConnector 时,无需额外的服务器端处理即可完成数据解析。

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.