addShortcut

adds a new keyboard shortcut

void addShortcut(string shortcut,function handler, [string scope] );
shortcutstringthe key name or the name of keys combination for a shortcut (shortcut syntax)
handlerfunctionthe handler of the shortcut call
scopestringoptional, the name of the context element to attach the handler function to (list of scopes); "gantt" by default

Example

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

Related samples

Details

This method is defined in the keyboard_navigation extension, so you need to activate the keyboard_navigation plugin. Read the details in the Keyboard Navigation article.

added in version 4.1

In case the third parameter is not set, the handler will be attached to the gantt scope.

See also
Back to top