registerShortcut

Registers a new shortcut for the TaskBoard.

Example

<div id="taskBoard"></div>

<script>
    var taskBoard = $("#taskBoard").kendoTaskBoard({
        dataOrderField: "order",
        dataSource: [
            { id: 1, order: 1, title: "Task 1", description: "Description 1", status: "backlog", category: "red" },
            { id: 2, order: 2, title: "Task 11", description: "Description 11", status: "backlog", category: "red" },
            { id: 3, order: 3, title: "Task 2", description: "Description 2", status: "doing", category: "green" },
            { id: 4, order: 4, title: "Task 22", description: "Description 22", status: "doing", category: "green" },
            { id: 5, order: 5, title: "Task 3", description: "Description 3", status: "done", category: "blue" }
        ],
        columns: [
            { text: "Backlog", status: "backlog" },
            { text: "Doing", status: "doing" },
            { text: "Done", status: "done" }
        ],
    }).data("kendoTaskBoard");

    // Focus the last card in TaskBoard
    taskBoard.registerShortcut("*", {
        keyCode: "q",
        ctrlKey: true
    }, {
        handler: function () {
            taskBoard.items().last().focus();
        }
    });

    // Create custom shortcut to open Preview pane on a card
    taskBoard.registerShortcut(".k-taskboard-card", {
        keyCode: "d",
        altKey: true
    }, {
        command: "OpenPaneCommand",
        options: { value: "Preview" },
        handler: function (ev) {
          ev.preventDefault();
        }
    });
</script>

Parameters

selector String

The jQuery selector to match the element(s) on which the shortcut to be affected.

shortcut Object

The shortcut definition.

options Object

The options of the shortcut execution

options.command String

The command to be executed

options.options String

Command-specific options

options.handler Function

A function callback.

In this article