hotkey
Description
Fires when applying a hotkey in the tableUsage
"hotkey": ({
key: string,
event: any,
isInput?: boolean
}) => boolean | void;
Parameters
The callback of the action takes an object with the following parameters:
key- (required) a hotkey name, for the combination of hotkeys use "+", e.g. "shift+arrowup"event- (required) keyboard eventisInput- (optional) enables/disables a hotkey inside the editor
Returning false from the event handler will disable hotkeys usage within the widget.
Example
<script setup>
import { Grid } from "@svar-ui/vue-grid";
import { getData } from "./common/data";
const { data, columns } = getData();
function init(api){
api.on("hotkey", ({ key, isInput }) => {
console.log(`key ${key} was pressed`);
});
}
</script>
<template>
<Grid :init="init" :data="data" :columns="columns" />
</template>
Related sample: Custom Hotkeys
Related articles: