DependencyBaseModel
Base class used for both Scheduler and Gantt. Not intended to be used directly
Properties
65
Properties
65Class hierarchy
Dependency
Property which encapsulates the lag's magnitude and units. An object which contains two properties:
| Parameter | Type | Description |
|---|---|---|
fullLag.magnitude | Number | The magnitude of the duration |
fullLag.unit | DurationUnitShort | The unit in which the duration is measured, eg
|
An enumerable object, containing names for the dependency types integer constants.
- 0 StartToStart
- 1 StartToEnd
- 2 EndToStart
- 3 EndToEnd
Editing
Returns true if the linked events have been persisted (e.g. neither of them are 'phantoms')
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.
JSON
Parent & children
Functions
62
Functions
62Dependency
Applies given CSS class to dependency, the value doesn't persist
| Parameter | Type | Description |
|---|---|---|
cls | String |
Checks if the given CSS class is applied to dependency.
| Parameter | Type | Description |
|---|---|---|
cls | String |
| Parameter | Type | Description |
|---|---|---|
type | Number |
Sets lag and lagUnit in one go. Only allowed way to change lagUnit, the lagUnit field is readonly after creation
| Parameter | Type | Description |
|---|---|---|
lag | Number | String | Object | The lag value. May be just a numeric magnitude, or a full string descriptor eg '1d' |
lagUnit | DurationUnitShort | Unit for numeric lag value, see lagUnit for valid values |
Removes given CSS class from dependency if applied, the value doesn't persist
| Parameter | Type | Description |
|---|---|---|
cls | String |
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
| Parameter | Type | Description |
|---|---|---|
field | String | Object | The field to set value for, or an object with multiple values to set in one call |
value | * | Value to set |
silent | Boolean | Set to |
Other
Returns the default dependency type value from the model's field definition.
The default type (2 = EndToStart by default)
Configuration
Events
Parent & children
Typedefs
2
Typedefs
2| Parameter | Type | Description |
|---|---|---|
StartToStart | Number | Start-to-Start ( |
StartToEnd | Number | Start-to-Finish ( |
EndToStart | Number | Finish-to-Start ( |
EndToEnd | Number | Finish-to-Finish ( |
Fields
11
Fields
11Dependency
Bidirectional, drawn with arrows in both directions
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.
Start side on source (top, left, bottom, right)
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 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.
End side on target (top, left, bottom, right)
Styling
CSS class to apply to lines drawn for the dependency