DependencyBaseModel

Base class used for both Scheduler and Gantt. Not intended to be used directly

Properties

65

Class hierarchy

isDependencyBaseModel: Boolean= truereadonly
Identifies an object as an instance of DependencyBaseModel class, or subclass thereof.
isDependencyBaseModel: Boolean= truereadonlystatic
Identifies an object as an instance of DependencyBaseModel class, or subclass thereof.
isModelModel
isModelLinkModelLink
isModelStmModelStm
isTreeNodeTreeNode

Dependency

Property which encapsulates the lag's magnitude and units. An object which contains two properties:

ParameterTypeDescription
fullLag.magnitudeNumber

The magnitude of the duration

fullLag.unitDurationUnitShort

The unit in which the duration is measured, eg 'd' for days

hardType: Number

Alias to dependency type, but when set resets fromSide & toSide to null as well.

Type: DependencyTypereadonlystatic

An enumerable object, containing names for the dependency types integer constants.

  • 0 StartToStart
  • 1 StartToEnd
  • 2 EndToStart
  • 3 EndToEnd

Editing

isPersistable: Booleanreadonly

Returns true if the linked events have been persisted (e.g. neither of them are 'phantoms')

isValid: Boolean

Returns true if the dependency is valid. It is considered valid if it has a valid type and both from and to events are set and pointing to different events.

copyOfModel

Fields

allFieldsstaticModel
autoExposeFieldsstaticModel
childrenFieldstaticModel
defaultsstaticModel
fieldMapstaticModel
fieldsstaticModel
idFieldstaticModel

Grouping

Identification

keyModel

JSON

jsonModel

Lifecycle

configBase

Linked records

hasLinksModelLink
isLinkedModelLink
recordLinksModelLink

Misc

stmModelStm

Other

$namestaticModel
relationsstaticModel

Parent & children

allChildrenTreeNode
childLevelTreeNode
firstChildTreeNode
isLeafTreeNode
isLoadedTreeNode
isParentTreeNode
isRootTreeNode
lastChildTreeNode
nextSiblingTreeNode
parentTreeNode
parentIdTreeNode

Functions

62

Dependency

Returns dependency hard type, see hardType.

Returns: Number

Applies given CSS class to dependency, the value doesn't persist

ParameterTypeDescription
clsString

Checks if the given CSS class is applied to dependency.

ParameterTypeDescription
clsString
Returns: Boolean

Sets dependency type and resets fromSide and toSide to null.

ParameterTypeDescription
typeNumber

Sets lag and lagUnit in one go. Only allowed way to change lagUnit, the lagUnit field is readonly after creation

ParameterTypeDescription
lagNumber | String | Object

The lag value. May be just a numeric magnitude, or a full string descriptor eg '1d'

lagUnitDurationUnitShort

Unit for numeric lag value, see lagUnit for valid values

Removes given CSS class from dependency if applied, the value doesn't persist

ParameterTypeDescription
clsString

Editing

Set value for the specified field(s), triggering engine calculations immediately. See Model#set() for arguments. *

dependency.set('from', 2);
// dependency.fromEvent is not yet up to date

await dependency.setAsync('from', 2);
// dependency.fromEvent is up to date
ParameterTypeDescription
fieldString | Object

The field to set value for, or an object with multiple values to set in one call

value*

Value to set

silentBoolean

Set to true to not trigger events automatically.

copyModel
getDataModel
removeModel
setModel

Other

Returns the default dependency type value from the model's field definition.

Returns: Number -

The default type (2 = EndToStart by default)

Configuration

applyDefaultsstaticBase

Events

Fields

addFieldstaticModel
getModel
processFieldstaticModel
removeFieldstaticModel

Identification

asIdstaticModel
generateIdstaticModel

JSON

toJSONModel

Lifecycle

destroystaticBase

Misc

equalsModel
initClassstaticBase
isOfTypeNamestaticBase
linkModelLink
mixinstaticBase

Parent & children

appendChildTreeNode
bubbleTreeNode
bubbleWhileTreeNode
containsTreeNode
insertChildTreeNode
isExpandedTreeNode
removeChildTreeNode
traverseTreeNode

Typedefs

2
ParameterTypeDescription
StartToStartNumber

Start-to-Start (0): The successor event cannot start before the predecessor starts

StartToEndNumber

Start-to-Finish (1): The successor event cannot finish before the predecessor starts

EndToStartNumber

Finish-to-Start (2): The successor event cannot start before the predecessor finishes

EndToEndNumber

Finish-to-Finish (3): The successor event cannot finish before the predecessor finishes

Fields

11

Dependency

bidirectional: Boolean

Bidirectional, drawn with arrows in both directions

from: String | Number

From event, id of source event

Gets/sets the source event of the dependency.

Accepts multiple formats but always returns an EventModel.

NOTE: This is not a proper field but rather an alias, it will be serialized but cannot be remapped. If you need to remap, consider using from instead.

fromSide: top | left | bottom | right

Start side on source (top, left, bottom, right)

lag: Number

The magnitude of this dependency's lag (the number of units).

The units of this dependency's lag, defaults to "d" (days). Valid values are:

  • "ms" (milliseconds)
  • "s" (seconds)
  • "m" (minutes)
  • "h" (hours)
  • "d" (days)
  • "w" (weeks)
  • "M" (months)
  • "y" (years)

This field is readonly after creation, to change lagUnit use setLag().

to: String | Number

To event, id of target event

Gets/sets the target event of the dependency.

Accepts multiple formats but always returns an EventModel.

NOTE: This is not a proper field but rather an alias, it will be serialized but cannot be remapped. If you need to remap, consider using to instead.

toSide: top | left | bottom | right

End side on target (top, left, bottom, right)

type: Number

Dependency type, see static property Type

Styling

cls: String

CSS class to apply to lines drawn for the dependency