HeaderMenu
Description
HeaderMenu componentUsage
<HeaderMenu {api} {columns} />
You can import the component from wx-svelte-grid.
Parameters
api
- the api gateway object to bind the component to the DataGridcolumns
- an object with columns IDs where each value is set to true (to show the menu for a column) or false (hide the column menu); true is set by default
Example
The example below shows how to add the header menu for specific columns:
<script>
import { getData } from "./common/data";
import { Grid, HeaderMenu } from "wx-svelte-grid";
const { data, columns } = getData();
let table;
function init(api) {
table = api;
}
</script>
<HeaderMenu api={table} columns={{ city: true, firstName: true, id: true }} >
<Grid {data} {columns} {init} />
</HeaderMenu>
Related articles: