v7.3.0
SupportExamplesFree Trial

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
No results

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.

  • triggerEvent : Stringdependencydblclick
    DependencyEdit

    The event that shall trigger showing the editor. Defaults to dependencydblclick, set to empty string or null to 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 false to disable localization of this object.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isDependencyEdit : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of DependencyEdit class, or subclass thereof.
  • isEvents : Booleantrue
    READONLY
    static
    ADVANCED
    Events
    Identifies an object as an instance of Events class, or subclass thereof.
  • isLocalizable : Booleantrue
    READONLY
    static
    ADVANCED
    Localizable
    Identifies an object as an instance of Localizable class, or subclass thereof.
  • properties : Object
    internal
    static
    DependencyEdit

    A class property getter for the default values of internal properties for this class.

  • emptyArray : Array
    internal
    READONLY
    DependencyEdit

    An empty array that can be used as a default value.

  • emptyObject : Object
    internal
    READONLY
    DependencyEdit

    An empty object that can be used as a default value.

  • isDependencyEdit : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of DependencyEdit class, or subclass thereof.
  • isInstancePlugin : Booleantrue
    READONLY
    ADVANCED
    DependencyEdit
    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

  • triggerEvent : Stringdependencydblclick
    DependencyEdit

    The event that shall trigger showing the editor. Defaults to dependencydblclick, set to empty string or null to disable editing of dependencies.

    Has a corresponding triggerEvent config.

  • config : Object
    READONLY
    ADVANCED
    DependencyEdit

    Returns a copy of the full configuration which was used to configure this object.

  • This property is set to true before the constructor returns.

  • isDestroying : Boolean
    READONLY
    ADVANCED
    DependencyEdit

    This property is set to true on entry to the destroy method. It remains on the objects after returning from destroy(). If isDestroyed is true, this property will also be true, so there is no need to test for both (for example, comp.isDestroying || comp.isDestroyed).

  • client : Widget
    READONLY
    ADVANCED
    DependencyEdit

    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
  • onClassMixedIn( )
    internal
    static
    DependencyEdit

    This optional class method is called when a class is mixed in using the mixin() method.

  • initClass( )
    static
    ADVANCED
    DependencyEdit

    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

  • doDestroy( )
    internal
    Events

    Auto detaches listeners registered from start, if set as detachable

  • once( )
    private
    Events

    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.

Events

Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

Event handlers

Event handlers are callbacks called as a result of certain actions in this class
id: dependencyEdit

Source path

SchedulerPro/feature/DependencyEdit.js

Demo

examples/dependencies

Contents