Skip to main content

print

Description

Fires when printing the table

Usage

"scroll": ({
mode?: "landscape"|"portrait",
paper?: "a3", "a4", "letter",
ppi?: number,
});

Parameters

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

  • mode - (optional) print mode that can be "landscape" or "portrait"
  • paper - (optional) paper size and format that can be "a3", "a4", "letter"
  • ppi - (optional) resolution in pixels of a table; 100 is set by default

Example

<script>
import { Button } from "wx-svelte-core"; // import the Button component
import { Grid } from "wx-svelte-grid";
import { getData } from "../data";

const { data, columns } = getData();

let api;

function printGrid(api) {
api.exec("print");
}
</script>

<Button onclick={() => printGrid(api)} type={"primary"}>Print Grid</Button>

<div style="height: 400px; margin-top: 10px;">
<Grid
bind:this={api}
{data}
{columns}
/>
</div>

Related articles: