DependencyEdit
Feature
Extends the Scheduler's DependencyEdit feature to integrate with the Scheduler Pro scheduling engine. It displays a popup containing fields for editing dependency data such as type, lag, and active state. All edits, saves, and deletions performed through this editor are wrapped in project transactions, ensuring that the scheduling engine processes the changes atomically and can revert them on cancel.
targetElement.innerHTML = '<p>This demo shows the dependency editing feature, double-click a dependency line to edit:</p>'; // Project contains all the data and is responsible for correct scheduling const project = new ProjectModel({ resources : [ { id : 1, name : 'John Smith' }, { id : 2, name : 'Mary Thompson' } ], events : [ { id : 2, name : 'Proof-read docs', startDate : '2017-01-02', endDate : '2017-01-05' }, { id : 3, name : 'Release docs', startDate : '2017-01-09', endDate : '2017-01-10' } ], assignments : [ { id : 1, resource : 1, event : 2 }, { id : 2, resource : 2, event : 3 } ], dependencies : [ { id : 1, fromEvent : 2, toEvent : 3 } ] }); const scheduler = new SchedulerPro({ appendTo : targetElement, flex : '1 0 100%', project, // SchedulerPro needs project to get schedule data from startDate : new Date(2016, 11, 31), endDate : new Date(2017, 0, 11), height : 300, features : { // Enable dependency editing feature dependencyEdit : true }, columns : [ { field : 'name', text : 'Name' } ] }); This feature is disabled by default. For info on enabling it, see GridFeatures.
Useful configs
| Config | Description |
|---|---|
| showLagField | Show/hide the lag field in the editor |
| editorConfig | Configuration for the dependency popup |
| autoClose | Close editor on outside click |
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
True to hide this editor if a click is detected outside it (defaults to true)
-
Default editor configuration, used to configure the Popup.
-
True to save and close this panel if ENTER is pressed in one of the input fields inside the panel.
-
The event that shall trigger showing the editor. Defaults to
dependencydblclick, set to empty string ornullto disable editing of dependencies.Has a corresponding runtime triggerEvent property.
-
True to show a delete button in the form.
-
True to show the lag field for the dependency
-
Internal listeners, that cannot be removed by the user.
-
The widget which this plugin is to attach to.
Has a corresponding runtime client property.
-
Set to
falseto disable localization of this object.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of DependencyEdit class, or subclass thereof.
-
Identifies an object as an instance of Events class, or subclass thereof.
-
Identifies an object as an instance of Localizable class, or subclass thereof.
-
A class property getter for the default values of internal properties for this class.
-
An empty array that can be used as a default value.
-
An empty object that can be used as a default value.
-
Identifies an object as an instance of DependencyEdit class, or subclass thereof.
-
Identifies an object as an instance of InstancePlugin class, or subclass thereof.
-
Reference to the cancel button, if used
-
Reference to the delete button, if used
-
Reference to the source task name field
-
Reference to the lag field
-
Reference to the save button, if used
-
Reference to the target task name field
-
Reference to the dependency type field
-
The event that shall trigger showing the editor. Defaults to
dependencydblclick, set to empty string ornullto disable editing of dependencies.Has a corresponding triggerEvent config.
-
Returns a copy of the full configuration which was used to configure this object.
-
This property is set to
truebefore theconstructorreturns. -
This property is set to
trueon entry to the destroy method. It remains on the objects after returning fromdestroy(). If isDestroyed istrue, this property will also betrue, so there is no need to test for both (for example,comp.isDestroying || comp.isDestroyed). -
The Widget which was passed into the constructor, which is the Widget we are providing extra services for.
Has a corresponding client config.
-
Get the global LocaleHelper
-
Get the global LocaleManager
Functions
Functions are methods available for calling on the class-
This optional class method is called when a class is mixed in using the mixin() method.
-
Registers this class type with its Factory
-
Delete dependency being edited
Triggers: beforeDependencyDelete
-
Sets fields values from record being edited
-
Updates record being edited with values from the editor
-
Internal function used to hook destroy() calls when using thisObj
-
Internal function used restore hooked destroy() calls when using thisObj
-
Auto detaches listeners registered from start, if set as detachable
-
Internal function used to run a callback function after an event is triggered
-
Removes all listeners registered to this object by the application.
-
This will merge a feature's (subclass of InstancePlugin) keyMap with it's client's keyMap.