Skip to content

Events And Lifecycle

This page documents 33 public symbols exported by @revolist/revogrid-enterprise.

createGanttBeforeTaskChangeValidationHandler

Section titled “createGanttBeforeTaskChangeValidationHandler”

function

export function createGanttBeforeTaskChangeValidationHandler<TContext>(options: GanttValidationHandlerOptions<TContext>): (event: CustomEvent<GanttBeforeTaskChangeDetail>) => void;
ParameterTypeRequiredDefaultDescription
optionsGanttValidationHandlerOptions<TContext>Yes

Related types: GanttBeforeTaskChangeDetail, GanttValidationHandlerOptions

constant

Cancelable event fired before task assignments are modified.

export const GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT: "gantt-before-assignment-change";

constant

Cancelable event fired before a dependency is created, deleted, or edited.

export const GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT: "gantt-before-dependency-change";

constant

Cancelable event fired before a task is created, moved, resized, or edited.

export const GANTT_BEFORE_TASK_CHANGE_EVENT: "gantt-before-task-change";

constant

Fired when the user hovers over a dependency arrow.

export const GANTT_DEPENDENCY_HOVER_EVENT: "gantt-dependency-hover";

constant

Fired when the user clicks a dependency arrow.

export const GANTT_DEPENDENCY_SELECT_EVENT: "gantt-dependency-select";

constant

Internal history marker used to record Gantt timeline mutations without replaying them immediately.

export const GANTT_HISTORY_RECORD_EVENT: "gantt-history-record";

constant

Fired when the user resizes the table/timeline panel divider.

export const GANTT_PANEL_RESIZE_EVENT: "gantt-panel-resize";

constant

Dispatched to filter visible Gantt rows by a free-text query.

export const GANTT_SEARCH_EVENT: "gantt-search";

constant

Dispatched to convert the selected task into a milestone.

export const GANTT_TASK_CONVERT_TO_MILESTONE_EVENT: "gantt-task-convert-to-milestone";

constant

Dispatched to create a new task. Provide {@link GanttCreateTaskOptions} as the detail.

export const GANTT_TASK_CREATE_EVENT: "gantt-task-create";

constant

Fired after a task is created and selected.

export const GANTT_TASK_CREATED_EVENT: "gantt-task-created";

constant

Dispatched to delete the selected task and its descendants.

export const GANTT_TASK_DELETE_EVENT: "gantt-task-delete";

constant

Dispatched to open editing UI for a task.

export const GANTT_TASK_EDIT_EVENT: "gantt-task-edit";

constant

Dispatched to indent (demote) the selected task one level deeper.

export const GANTT_TASK_INDENT_EVENT: "gantt-task-indent";

constant

Dispatched to outdent (promote) the selected task one level up.

export const GANTT_TASK_OUTDENT_EVENT: "gantt-task-outdent";

constant

Dispatched to zoom in by one level.

export const GANTT_ZOOM_IN_EVENT: "gantt-zoom-in";

constant

Dispatched to zoom out by one level.

export const GANTT_ZOOM_OUT_EVENT: "gantt-zoom-out";

constant

Dispatched to jump directly to a specific zoom level by id.

export const GANTT_ZOOM_SET_LEVEL_EVENT: "gantt-zoom-set-level";

type

Kind of assignment mutation that triggered the before-change event.

export type GanttBeforeAssignmentChangeAction = 'edit';

interface

Detail payload for the cancelable {@link GANTT_BEFORE_ASSIGNMENT_CHANGE_EVENT}. Call event.preventDefault() to block the change.

export interface GanttBeforeAssignmentChangeDetail {
readonly action: GanttBeforeAssignmentChangeAction;
readonly taskId: TaskId;
readonly assignments: readonly AssignmentEntity[];
readonly previousAssignments: readonly AssignmentEntity[];
}
MemberType / returnRequiredDefaultDescription
action"edit"Yes
taskIdstringYes
assignmentsreadonly AssignmentEntity[]Yes
previousAssignmentsreadonly AssignmentEntity[]Yes

Related types: AssignmentEntity, GanttBeforeAssignmentChangeAction, TaskId

type

Kind of dependency mutation that triggered the before-change event.

export type GanttBeforeDependencyChangeAction = 'create' | 'delete' | 'edit' | 'replace';

interface

Detail payload for the cancelable {@link GANTT_BEFORE_DEPENDENCY_CHANGE_EVENT}. Call event.preventDefault() to block the change.

export interface GanttBeforeDependencyChangeDetail {
readonly action: GanttBeforeDependencyChangeAction;
readonly dependencyId: DependencyId | null;
readonly dependency: DependencyEntity | null;
readonly previousDependency?: DependencyEntity | null;
/** Full proposed dependency set for batch replacements. */
readonly dependencies?: readonly DependencyEntity[];
/** Full previous dependency set for batch replacements. */
readonly previousDependencies?: readonly DependencyEntity[];
}
MemberType / returnRequiredDefaultDescription
actionGanttBeforeDependencyChangeActionYes
dependencyIdstring | nullYes
dependencyDependencyEntity | nullYes
previousDependencyDependencyEntity | null | undefinedNo
dependenciesreadonly DependencyEntity[] | undefinedNoFull proposed dependency set for batch replacements.
previousDependenciesreadonly DependencyEntity[] | undefinedNoFull previous dependency set for batch replacements.

Related types: DependencyEntity, DependencyId, GanttBeforeDependencyChangeAction

type

Kind of task mutation that triggered the before-change event.

export type GanttBeforeTaskChangeAction = 'move' | 'resize' | 'create' | 'edit' | 'progress' | 'split' | 'indent' | 'outdent' | 'delete' | 'convert-to-milestone';

interface

Detail payload for the cancelable {@link GANTT_BEFORE_TASK_CHANGE_EVENT}. Call event.preventDefault() to block the change.

export interface GanttBeforeTaskChangeDetail {
readonly action: GanttBeforeTaskChangeAction;
readonly taskId: TaskId | null;
/** Partial task with proposed values */
readonly changes: Partial<TaskEntity>;
/** Previous values of fields being changed */
readonly previousValues: Partial<TaskEntity>;
/** Source row that will receive the task-row write, when available. */
readonly sourceRow?: DataType;
/** Physical source row index that will receive the mapped write, when available. */
readonly sourceIndex?: number;
/** Proposed flat source-row patch for this task row. */
readonly sourcePatch?: Record<string, unknown>;
/** Previous source values for the keys in `sourcePatch`. */
readonly previousSourceValues?: Record<string, unknown>;
}
MemberType / returnRequiredDefaultDescription
actionGanttBeforeTaskChangeActionYes
taskIdstring | nullYes
changesPartial<TaskEntity>YesPartial task with proposed values
previousValuesPartial<TaskEntity>YesPrevious values of fields being changed
sourceRowDataType | undefinedNoSource row that will receive the task-row write, when available.
sourceIndexnumber | undefinedNoPhysical source row index that will receive the mapped write, when available.
sourcePatchRecord<string, unknown> | undefinedNoProposed flat source-row patch for this task row.
previousSourceValuesRecord<string, unknown> | undefinedNoPrevious source values for the keys in sourcePatch.

Related types: GanttBeforeTaskChangeAction, TaskEntity, TaskId

type

export type GanttBeforeTaskChangeValidator<TContext = GanttValidationContext> = (
detail: GanttBeforeTaskChangeDetail,
context: TContext,
) => GanttValidationDecision | boolean;

Related types: GanttBeforeTaskChangeDetail, GanttValidationContext, GanttValidationDecision

interface

Detail payload for dependency hover/select events.

export interface GanttDependencyInteractionDetail {
/** Dependency id, or `null` when the interaction is cleared. */
readonly dependencyId: DependencyId | null;
/** Full dependency entity, or `null` when cleared. */
readonly dependency: DependencyEntity | null;
}
MemberType / returnRequiredDefaultDescription
dependencyIdstring | nullYesDependency id, or null when the interaction is cleared.
dependencyDependencyEntity | nullYesFull dependency entity, or null when cleared.

Related types: DependencyEntity, DependencyId

interface

export interface GanttExampleCancelableEvent<TDetail> {
readonly detail: TDetail;
preventDefault(): void;
}
MemberType / returnRequiredDefaultDescription
detailTDetailYes
preventDefault()voidYes

interface

Detail payload for panel resize events.

export interface GanttPanelResizeEventDetail {
/** New panel width in pixels. */
readonly width: number;
}
MemberType / returnRequiredDefaultDescription
widthnumberYesNew panel width in pixels.

interface

Detail payload for Gantt search events.

export interface GanttSearchEventDetail {
/** Free-text query matched against task rows, assignees, dates, status, tags, and costs. */
readonly query: string;
}
MemberType / returnRequiredDefaultDescription
querystringYesFree-text query matched against task rows, assignees, dates, status, tags, and costs.

interface

Detail payload for the post-create task event.

export interface GanttTaskCreatedEventDetail {
/** Created task id. */
readonly taskId: TaskId;
/** Created task entity. */
readonly task: TaskEntity;
/**
* Whether task-created listeners such as the packaged editor should open a
* follow-up UI for the new task.
*/
readonly openEditor?: boolean;
}
MemberType / returnRequiredDefaultDescription
taskIdstringYesCreated task id.
taskTaskEntityYesCreated task entity.
openEditorboolean | undefinedNoWhether task-created listeners such as the packaged editor should open a follow-up UI for the new task.

Related types: TaskEntity, TaskId

interface

Detail payload for task edit requests.

export interface GanttTaskEditEventDetail {
/** Task id to edit. */
readonly taskId: TaskId;
}
MemberType / returnRequiredDefaultDescription
taskIdstringYesTask id to edit.

Related types: TaskId

function

export function validateGanttBeforeTaskChange<TContext>(detail: GanttBeforeTaskChangeDetail, context: TContext, validators: readonly GanttBeforeTaskChangeValidator<TContext>[]): GanttValidationDecision;
ParameterTypeRequiredDefaultDescription
detailGanttBeforeTaskChangeDetailYes
contextTContextYes
validatorsreadonly GanttBeforeTaskChangeValidator<TContext>[]Yes

Related types: GanttBeforeTaskChangeDetail, GanttBeforeTaskChangeValidator, GanttValidationDecision