focus-cell
Description
Fires when a cell is given focusUsage
"focus-cell": ({
row?: string | number,
column?: string | number,
eventSource?: string,
}) => boolean|void;
Parameters
The callback of the action takes an object with the following parameters:
row- (optional) an id of the selected rowcolumn- (optional) an id of the selected columneventSource- (optional) the name of the Grid action used to triggerfocus-cell
Example
<script setup>
import { getData } from "../data";
import { Grid } from "@svar-ui/vue-grid";
const { data, columns } = getData();
function init(api){
api.on("focus-cell", ev => {
console.log(`Cell in focus is in row:", ${ev.row}, and triggered by ${ev.eventSource}`);
});
}
</script>
<template>
<div style="padding: 20px;">
<div>
<Grid :data="data" :columns="columns" :init="init"/>
</div>
</div>
</template>
Related articles: