跳到主要内容

addShortcut

Description

添加一个新的键盘快捷键

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

Parameters

  • shortcut - (required) string - 快捷键的按键名称,或快捷键组合的名称 快捷键语法
  • handler - (required) function - 快捷键调用的处理函数

Example

gantt.addShortcut("shift+w", function(e){ 
var task = gantt.locate(e);
if(task)
gantt.showQuickInfo(task)
},"taskRow");

Details

注释

此方法定义在 keyboard_navigation 扩展中,因此您需要启用 keyboard_navigation 插件。请在 Keyboard Navigation 文章中查看详细信息。

added in version 4.1

在版本 4.1 中新增

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.