跳转到主要内容

setEvent

Description

向调度器的数据池中添加一个新的事件

setEvent: (id: string | number, event: any) => void

Parameters

  • id - (required) string | number - 事件的ID
  • event - (required) object - 事件对象

Example

scheduler.setEvent(1, {
start_date: new Date(2013, 05, 16, 09, 00),
end_date: new Date(2013, 05, 16, 12, 00),
text: "Meeting",
holder: "John",
room: "5"
});
scheduler.setCurrentView();

Details

此方法的工作原理与 addEvent 类似。

setEvent()addEvent() 之间的主要区别是:

  • addEvent 方法会将事件添加到调度器显示中,并触发 onEventAdded / onEventChanged 事件,这些事件可以用来更新原始数据源(如数据库)。
  • setEvent() 方法仅将事件添加到内部数据池中,不会触发任何事件。若要使用新事件更新调度器显示,需要单独调用 setCurrentView
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.