Skip to main content

focus-cell

Description

Fires when a cell is given focus

Usage

"focus-cell": ({
row?: string | number,
column?: string | number,
eventSource: string,
});

Parameters

The callback of the action takes an object with the following parameters:

  • row - (optional) an id of the selected row
  • column - (optional) an id of the selected column
  • eventSource - (required) the name of the Grid action used to trigger focus-cell

Example

<script>
import { getData } from "../data";
import { Grid } from "wx-svelte-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>

<div style="padding: 20px;">
<div>
<Grid {data} {columns} {init}/>
</div>
</div>

Related articles: