Events And Methods
Get The Plugin
Section titled “Get The Plugin”Outside plugin code, locate the runtime through the grid's plugin collection.
import { GanttPlugin } from '@revolist/revogrid-enterprise';
const plugins = await grid.getPlugins();const gantt = plugins.find((plugin) => plugin instanceof GanttPlugin);Do not install reverse callbacks or custom methods directly on the grid element.
Public Method Groups
Section titled “Public Method Groups”| Purpose | Methods |
|---|---|
| Project lifecycle | applyGantt, clearGantt, getProjectSnapshot |
| Zoom and range | zoomIn, zoomOut, setZoomLevel, getZoomLevel, canZoomIn, canZoomOut, getVisibleRange |
| Tasks | createTask, updateTask, finalizeTaskCreate, discardTaskCreate |
| Hierarchy | indentTask(s), outdentTask(s), deleteTask(s), convertTask(s)ToMilestones |
| Baselines | captureBaseline |
Use the Gantt API for exact signatures and return types.
Cancelable Before-Change Events
Section titled “Cancelable Before-Change Events”Call preventDefault() to reject a proposed packaged mutation.
grid.addEventListener('gantt-before-task-change', (event) => { if (!canEditTask(event.detail.taskId, event.detail.action)) { event.preventDefault(); }});| Event | When it fires |
|---|---|
gantt-before-task-change | Before create, move, resize, edit, progress, split, indent, outdent, delete, or milestone conversion. |
gantt-before-dependency-change | Before dependency create, delete, edit, or set replacement. |
gantt-before-assignment-change | Before task assignments are edited. |
Commands And Notifications
Section titled “Commands And Notifications”The grid also uses typed events for task creation/edit requests, hierarchy commands, zoom, search, dependency hover/selection, task-created notification, and panel resize. Prefer exported event constants when code must be refactor-safe.
import { GANTT_TASK_CREATE_EVENT, GANTT_ZOOM_IN_EVENT,} from '@revolist/revogrid-enterprise';
grid.dispatchEvent(new CustomEvent(GANTT_TASK_CREATE_EVENT));grid.dispatchEvent(new CustomEvent(GANTT_ZOOM_IN_EVENT));Application listeners should update or validate project data, not query rendered task-bar geometry. See Application State for persistence ownership.