跳转到主要内容

addShortcut

Description

创建一个新的键盘快捷键

addShortcut: (shortcut: string, handler: SchedulerCallback, scope?: string) => void

Parameters

  • shortcut - (required) string - 定义快捷键的键或组合键 (快捷键语法)
  • handler - (required) function - 快捷键触发时调用的函数
  • scope - (optional) string - (可选)指定处理函数绑定的上下文元素 (作用域列表)

Example

scheduler.addShortcut("shift+w", function(e){ 
var eventId = scheduler.locate(e);
if(eventId)
scheduler.showQuickInfo(eventId);
},"event");

Details

版本 4.4 中新增

如果省略第三个参数,处理函数默认绑定到 scheduler 作用域。

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.