Skip to main content

delete-row

Description

Fires when deleting a row

Usage

"delete-row": ({
id: string | number
}) = > boolean|void;

Parameters

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

  • id - (required) the ID of a row that is deleted

Returning false from the event handler will prevent deleting rows.

Example

<script>
import { getData } from "./common/data";
import { Grid } from "wx-svelte-grid";
import { Button } from "wx-svelte-core";
const { data, columns } = getData();

let api;

const deleteRow = () => {
api.exec("delete-row", {
id: 17,
});
};
</script>

<Button click={deleteRow} type="primary">Delete Row</Button>

<Grid {data} {columns} bind:api />

Related articles: