跳到主要内容

getShortcutHandler

Description

获取一个键盘导航快捷键处理程序

getShortcutHandler: (shortcut: string, scope: string) => GanttCallback

Parameters

  • shortcut - (required) string - 快捷键的键名,或快捷键组合的名称(shortcut syntax
  • scope - (required) string - 要附加处理函数的上下文元素名称(scopes 列表

Returns

  • shortcut_handler - (function) - 快捷键调用的处理程序

Example

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

gantt.getShortcutHandler("shift+w", "taskRow")

Details

注释

此方法在 keyboard_navigation 扩展中定义,因此需要激活 keyboard_navigation 插件。请参阅 Keyboard Navigation 文章的详细信息。

自版本4.2起新增

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.