UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

94 lines (93 loc) 4.1 kB
/** * DevExtreme (cjs/ui/gantt/ui.gantt.model_changes_listener.js) * Version: 24.2.6 * Build date: Mon Mar 17 2025 * * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; exports.ModelChangesListener = void 0; const GANTT_TASKS = "tasks"; const GANTT_DEPENDENCIES = "dependencies"; const GANTT_RESOURCES = "resources"; const GANTT_RESOURCE_ASSIGNMENTS = "resourceAssignments"; const ModelChangesListener = exports.ModelChangesListener = { create: gantt => ({ NotifyTaskCreated: (task, callback, errorCallback) => { gantt._onRecordInserted("tasks", task, callback) }, NotifyTaskRemoved: (taskId, errorCallback, task) => { gantt._onRecordRemoved("tasks", taskId, task) }, NotifyTaskUpdated: (taskId, newValues, errorCallback) => { gantt._onRecordUpdated("tasks", taskId, newValues) }, NotifyParentTaskUpdated: (task, errorCallback) => { gantt._onParentTaskUpdated(task) }, NotifyDependencyInserted: (dependency, callback, errorCallback) => { gantt._onRecordInserted("dependencies", dependency, callback) }, NotifyDependencyRemoved: (dependencyId, errorCallback, dependency) => { gantt._onRecordRemoved("dependencies", dependencyId, dependency) }, NotifyResourceCreated: (resource, callback, errorCallback) => { gantt._onRecordInserted("resources", resource, callback) }, NotifyResourceRemoved: (resourceId, errorCallback, resource) => { gantt._onRecordRemoved("resources", resourceId, resource) }, NotifyResourceAssigned: (assignment, callback, errorCallback) => { gantt._onRecordInserted("resourceAssignments", assignment, callback) }, NotifyResourceUnassigned: (assignmentId, errorCallback, assignment) => { gantt._onRecordRemoved("resourceAssignments", assignmentId, assignment) }, NotifyParentDataRecalculated: data => { gantt._onParentTasksRecalculated(data) }, NotifyTaskCreating: args => { gantt._actionsManager.raiseInsertingAction("tasks", args) }, NotifyTaskRemoving: args => { gantt._actionsManager.raiseDeletingAction("tasks", args) }, NotifyTaskUpdating: args => { gantt._actionsManager.raiseUpdatingAction("tasks", args) }, NotifyTaskMoving: args => { gantt._actionsManager.raiseUpdatingAction("tasks", args, gantt._actionsManager.getTaskMovingAction()) }, NotifyTaskEditDialogShowing: args => { gantt._actionsManager.raiseTaskEditDialogShowingAction(args) }, NotifyResourceManagerDialogShowing: args => { gantt._actionsManager.raiseResourceManagerDialogShowingAction(args) }, NotifyDependencyInserting: args => { gantt._actionsManager.raiseInsertingAction("dependencies", args) }, NotifyDependencyRemoving: args => { gantt._actionsManager.raiseDeletingAction("dependencies", args) }, NotifyResourceCreating: args => { gantt._actionsManager.raiseInsertingAction("resources", args) }, NotifyResourceRemoving: args => { gantt._actionsManager.raiseDeletingAction("resources", args) }, NotifyResourceAssigning: args => { gantt._actionsManager.raiseInsertingAction("resourceAssignments", args) }, NotifyResourceUnassigning: args => { gantt._actionsManager.raiseDeletingAction("resourceAssignments", args) }, NotifyScaleCellPrepared: args => { gantt._actionsManager.raiseScaleCellPreparedAction(args) }, NotifyGanttViewUpdated: () => { gantt._onGanttViewCoreUpdated() } }) };