Skip to content

Gantt Toolbar

export async function getGanttBaselineCaptureRuntime(
grid: HTMLRevoGridElement,
): Promise<GanttBaselineCaptureRuntime | undefined>;

export async function captureGanttBaseline(
grid: HTMLRevoGridElement,
options?: CaptureBaselineOptions,
): Promise<BaselineSnapshot | null>;

interface GanttBaselineCaptureRuntime {
captureBaseline(options?: CaptureBaselineOptions): BaselineSnapshot | null
}

Toggle critical-path highlighting on the grid’s Gantt visual config.

Returns the next visibility state, or undefined when the grid has no Gantt config to update.

export function toggleGanttCriticalPath(grid: HTMLRevoGridElement): boolean | undefined;

export async function getCsvExportPlugin(grid: HTMLRevoGridElement): Promise<RevoGridCsvExportPlugin | undefined>;

export async function exportGanttCsv(
grid: HTMLRevoGridElement,
options: GanttCsvExportOptions =;

export function exportGanttExcel(
grid: HTMLRevoGridElement,
options: GanttExcelExportOptions =;

interface GanttCsvExportOptions {
filename?: string;
bom?: boolean;
columnDelimiter?: string;
rowDelimiter?: string;
mime?: string;
encoding?: string
}

export type GanttExcelExportOptions = ExportExcelEvent;

interface RevoGridCsvExportPlugin {
exportFile(options?: GanttCsvExportOptions): Promise<void>
}

export async function getGanttTimelineNavigationRuntime(
grid: HTMLRevoGridElement,
): Promise<GanttTimelineNavigationRuntime | undefined>;

export async function scrollGanttToToday(
grid: HTMLRevoGridElement,
options: GanttTodayNavigationOptions =;

export async function fitGanttToProject(
grid: HTMLRevoGridElement,
options: GanttProjectFitOptions =;

interface GanttTimelineNavigationOptions {
align?: number
}

GanttTodayNavigationOptions (Extended from index.ts)

Section titled “GanttTodayNavigationOptions (Extended from index.ts)”
interface GanttTodayNavigationOptions {
date?: ISODateString
}

GanttProjectFitOptions (Extended from index.ts)

Section titled “GanttProjectFitOptions (Extended from index.ts)”
interface GanttProjectFitOptions {
viewportWidth?: number
}

interface GanttTimelineNavigationRuntime {
scrollToToday?: () => Promise<void> | void;
fitToProject?: () => Promise<void> | void;
getZoomLevel?: () => { id?: string } | null | undefined;
setZoomLevel?: (levelId: string) => boolean
}

Framework-neutral command descriptors for common Gantt toolbar additions.

Render the returned commands in any toolbar UI and call run() from the button handler. Creating the descriptors does not dispatch events, scroll, or mutate the grid.

export function createGanttToolbarQuickWinActions(
grid: HTMLRevoGridElement,
options: GanttToolbarQuickWinOptions =;

export function listGanttToolbarQuickWinActions(
actions: GanttToolbarQuickWinActions,
): readonly GanttToolbarQuickWinAction[];

export type GanttToolbarQuickWinActionId =
| 'export-csv'
| 'export-excel'
| 'capture-baseline'
| 'toggle-critical-path'
| 'timeline-today'
| 'timeline-fit-project';

interface GanttToolbarQuickWinAction {
readonly id: GanttToolbarQuickWinActionId;
readonly label: string;
readonly title: string;
readonly run: () => Result | Promise<Result>
}

interface GanttToolbarQuickWinOptions {
readonly csv?: GanttCsvExportOptions | false;
readonly excel?: GanttExcelExportOptions | false;
readonly baseline?: CaptureBaselineOptions | false;
readonly criticalPath?: false;
readonly today?: GanttTodayNavigationOptions | false;
readonly fitToProject?: GanttProjectFitOptions | false
}

interface GanttToolbarQuickWinActions {
readonly exportCsv?: GanttToolbarQuickWinAction<boolean>;
readonly exportExcel?: GanttToolbarQuickWinAction<CustomEvent<GanttExcelExportOptions>>;
readonly captureBaseline?: GanttToolbarQuickWinAction<BaselineSnapshot | null>;
readonly toggleCriticalPath?: GanttToolbarQuickWinAction<boolean | undefined>;
readonly scrollToToday?: GanttToolbarQuickWinAction<boolean>;
readonly fitToProject?: GanttToolbarQuickWinAction<boolean>
}

export function resolveHiddenColumnsFromToolbarSelection(
selectedValues: string | string[],
allProps: string[],
previousHiddenColumns: string[],
): string[];

GANTT_TOOLBAR_SELECT_ALL_COLUMNS: string;

GanttToolbar: ({ grid, columns, visuals: initialVisuals, controls }: GanttToolbarComponentProps) => preact.JSX.Element;

A single column entry shown in the Gantt toolbar column-visibility dropdown.

interface GanttToolbarColumnOption {
/** Property name matching a task-table column (e.g. `'wbs'`, `'status'`). */
prop: string;
/** Human-readable label shown in the dropdown. */
label: string;
/**
* Whether the column is visible by default.
* Columns with `visible: false` will be added to `grid.hideColumns` on mount.
* @default true
*/
visible?: boolean
}

Initial visual toggle state passed to the toolbar.

interface GanttToolbarVisuals {
showBaseline?: boolean;
showDependencies?: boolean;
showCriticalPath?: boolean
}

Visibility switches for each toolbar control or control group.

interface GanttToolbarControls {
search?: boolean;
history?: boolean;
undo?: boolean;
redo?: boolean;
tree?: boolean;
expandAll?: boolean;
collapseAll?: boolean;
zoom?: boolean;
zoomIn?: boolean;
zoomOut?: boolean;
tasks?: boolean;
addTask?: boolean;
indent?: boolean;
outdent?: boolean;
export?: boolean;
exportExcel?: boolean;
columns?: boolean;
dependencies?: boolean;
baseline?: boolean;
criticalPath?: boolean
}

Options accepted by {@link defineGanttToolbar}.

interface GanttToolbarOptions {
/** The `revo-grid` element the toolbar should control. */
grid: HTMLRevoGridElement;
/**
* Column options to show in the visibility dropdown.
* If omitted, no column dropdown is rendered.
*/
columns?: GanttToolbarColumnOption[];
/**
* Initial state of the visual/scheduling toggles.
* When omitted, values are read from the current `grid.gantt.visuals` config.
*/
visuals?: GanttToolbarVisuals;
/**
* Per-control visibility. Omitted options default to visible, except
* `baseline`, which is opt-in to keep the default command bar compact.
*/
controls?: GanttToolbarControls
}

  • Optional HistoryPlugin: Integrates with HistoryPlugin undo and redo controls when present.
  • Optional GanttPlugin: Integrates with Gantt runtime zoom and editing capabilities when present.
  • Event integration gantt-runtime: Dispatches and listens to Pro and Gantt events for toolbar controls.
ganttToolbarDependencies: PluginDependency[];

Mounts the Gantt editing toolbar into el and wires it to the given revo-grid element. Call this once after the grid’s gantt property has been set so the toolbar can read the initial visual config.

controls hides built-in controls. Omitted flags are visible by default, except baseline, which is opt-in.

import { defineGanttToolbar } from '@revolist/revogrid-enterprise';
const toolbarEl = document.querySelector('#gantt-toolbar');
const grid = document.querySelector('revo-grid');
defineGanttToolbar(toolbarEl, {
grid,
columns: [
{ prop: 'wbs', label: 'WBS', visible: true },
{ prop: 'name', label: 'Name', visible: true },
{ prop: 'startDate', label: 'Start Date', visible: true },
{ prop: 'duration', label: 'Duration', visible: true },
{ prop: 'status', label: 'Status', visible: true },
{ prop: 'endDate', label: 'End Date', visible: false },
],
visuals: {
showDependencies: true,
showBaseline: true,
showCriticalPath: true,
},
controls: {
search: true,
history: true,
undo: true,
redo: true,
tree: true,
expandAll: true,
collapseAll: true,
zoom: true,
zoomIn: true,
zoomOut: true,
tasks: true,
addTask: true,
indent: true,
outdent: true,
export: true,
exportExcel: true,
columns: true,
dependencies: true,
baseline: true,
criticalPath: true,
},
});
defineGanttToolbar: (el: HTMLElement, options: GanttToolbarOptions) => void;