v7.3.0
SupportExamplesFree Trial

DependencyEdit
Feature

Feature that displays a popup containing fields for editing a dependency. Requires the Dependencies feature to be enabled. Double-click a dependency line in the demo below to show the editor.

const scheduler = new Scheduler({ appendTo : targetElement, // makes scheduler as high as it needs to be to fit rows autoHeight : true, startDate : new Date(2018, 4, 6), endDate : new Date(2018, 4, 13), columns : [ { field : 'name', text : 'Name', width : 100 } ], resources : [ { id : 1, name : 'Bernard' }, { id : 2, name : 'Bianca' } ], events : [ { id : 1, resourceId : 1, name : 'Interview', startDate : '2018-05-06', endDate : '2018-05-07' }, { id : 2, resourceId : 1, name : 'Press meeting', startDate : '2018-05-08', endDate : '2018-05-09' }, { id : 3, resourceId : 2, name : 'Audition', startDate : '2018-05-07', endDate : '2018-05-09' }, { id : 4, resourceId : 2, name : 'Script deadline', startDate : '2018-05-11', endDate : '2018-05-11' } ], features : { dependencies : { clickWidth : 15 }, dependencyMenu : true, dependencyEdit : { editorConfig : { items : { // Custom label for the type field typeField : { label : 'Kind' } }, bbar : { items : { // Hiding save button saveButton : { hidden : true } } } } } }, dependencies : [ { id : 1, from : 1, to : 2, cls : 'dev-path' }, { id : 2, from : 2, to : 4 } ] });

Customizing the built-in widgets

 const scheduler = new Scheduler({
     columns : [
         { field : 'name', text : 'Name', width : 100 }
     ],
     features : {
         dependencies   : true,
         dependencyEdit : {
             editorConfig : {
                 items : {
                     // Custom label for the type field
                     typeField : {
                         label : 'Kind'
                     }
                 },

bbar : { items : { // Hiding save button saveButton : { hidden : true } } } } } } });

Built-in widgets

Widget ref Type Weight Description
fromNameField DisplayField 100 From task name (readonly)
toNameField DisplayField 200 To task name (readonly)
typeField Combo 300 Edit type
lagField DurationField 400 Edit lag

The built-in buttons are:

Widget ref Type Weight Description
saveButton Button 100 Save button on the bbar
deleteButton Button 200 Delete button on the bbar
cancelButton Button 300 Cancel editing button on the bbar

This feature is disabled by default. For info on enabling it, see GridFeatures.

Useful configs and functions

Member Description
beforeDependencyEditShow Fires before editor is shown
beforeDependencyEdit Fires before editing starts
beforeDependencySave Fires before save
beforeDependencyDelete Fires before delete
afterDependencySave Fires after dependency is saved

See also

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

    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
    InstancePlugin

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

  • cancelButton : Button
    READONLY

    Reference to the cancel button, if used

  • deleteButton : Button
    READONLY

    Reference to the delete button, if used

  • Reference to the source task name field

  • Reference to the lag field

  • saveButton : Button
    READONLY

    Reference to the save button, if used

  • Reference to the target task name field

  • typeField : Combo
    READONLY

    Reference to the dependency type field

  • emptyArray : Array
    internal
    READONLY
    InstancePlugin

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

  • emptyObject : Object
    internal
    READONLY
    InstancePlugin

    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
    InstancePlugin
    Identifies an object as an instance of InstancePlugin class, or subclass thereof.
  • triggerEvent : Stringdependencydblclick

    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
    InstancePlugin

    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
    InstancePlugin

    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
    InstancePlugin

    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
    InstancePlugin

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

  • initClass( )
    static
    ADVANCED
    InstancePlugin

    Registers this class type with its Factory

  • deleteDependency( )
    private
    ASYNC

    Delete dependency being edited


    Triggers: beforeDependencyDelete

  • loadRecord( )
    private

    Sets fields values from record being edited

  • updateRecord( )
    private

    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

Scheduler/feature/DependencyEdit.js

Demo

examples/dependencies

Contents