Skip to main content

hide-column

Description

Fires when hiding a column

Usage

"hide-column": ({
id: string,
mode: boolean
}) => boolean|void;

Parameters

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

  • id - (required) the ID of a column that is hidden
  • mode - (required) if set to true, hides a column; if false, a column is shown

Returning false from the event handler will block hiding a column.

Example

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

let api;

const hideColumn = () => {
api.exec("hide-column", { id: "firstName", mode: true });
};
</script>

<Button click={hideColumn} type="primary">Hide</Button>

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

Related articles: