setCurrentView
Description
显示指定的视图和日期
setCurrentView: (date?: Date, view?: string) => void
Parameters
date- (optional) Date - 要显示的日期view- (optional) string - 要显示的视图名称
Example
// 刷新当前视图和日期,不做任何更改
scheduler.setCurrentView();
// 显示当前视图中的2027年8月4日
scheduler.setCurrentView(new Date(2027, 7, 4));
// 在周视图中显示2027年6月3日
scheduler.setCurrentView(new Date(2027, 5, 3), "week");
Related samples
Details
- 默认视图的名称是 'day', 'week', 'month'. 要指定任何其他视图,请使用其
name参数。 - 该方法会触发
onBeforeViewChange和onViewChange。 - 该方法类似于
updateView()。唯一的区别是updateView()不会生成任何事件。
Related API
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.