Skip to main content

HeadertMenu

Description

HeaderMenu helper

Adds a header menu to columns in the grid area to dynamically hide and show them.

Usage

<HeaderMenu {api} {columns} />

You can import the component from wx-svelte-gantt .

Parameters

  • api - (required) Gantt API object
  • columns - (optional) hash of columns that can be hidden via HeaderMenu. If not provided, HeaderMenu options will include all Gantt columns

Example

The example below shows how to add a header menu to the grid columns and make possible to hide the "start" and "duration" columns:

<script>
import { getData } from "../data";
import { Gantt, HeaderMenu } from "wx-svelte-gantt";

const data = getData();
const columns = { start: true, duration: true };

let api = $state();
</script>
<HeaderMenu {api} {columns}>
<Gantt
bind:this={api}
tasks={data.tasks}
links={data.links}
scales={data.scales}
/>
</HeaderMenu>

Related articles: