DependencyCreation

Configs

12

Dependency creation

allowCreate: Boolean= true

Set to false to not allow creating dependencies

allowCreateOnlyParent: Boolean= false

Set it to true to allow dependency creation only for parent events (only applies to Scheduler Pro using the NestedEvents feature). Normally the nested event container inside parent events cannot be scrolled when using dependencies, but by enabling this setting and limiting to where dependencies can be drawn scrolling will be enabled.

false to require a drop on a target event bar side circle to define the dependency type. If dropped on the event bar, the defaultValue of the DependencyModel type field will be used to determine the target task side.

A tooltip config object that will be applied to the dependency creation Tooltip

A template function that will be called to generate the HTML contents of the dependency creation tooltip. You can return either an HTML string or a DomConfig object.

ParameterTypeDescription
dataObject

Data about the dependency being created

data.sourceTimeSpan

The from event

data.targetTimeSpan

The target event

data.fromSideString

The from side (start, end, top, bottom)

data.toSideString

The target side (start, end, top, bottom)

data.validBoolean

The validity of the dependency

Returns: String | DomConfig
showCreationTooltip: Boolean= true

false to not show a tooltip while creating a dependency

Dependency terminals

terminalCls: String= b-sch-terminal

CSS class used for terminals

Delay in ms before hiding the terminals when the mouse leaves an event bar or terminal.

Can be used to make the UI more forgiving, accidentally leaving the event bar or terminal will not immediately hide the terminals.

Can also be used to play a hide animation, set a terminalHideDelay that is longer than your animation's duration. The b-hiding-terminals CSS class is added to the event wrapper while the terminals are being hidden.

Terminal offset from their initial position, in px. Positive values move terminals further away from the event bar, negative values inside the event bar.

When unset, the value specified in the --b-dependency-terminal-offset CSS variable is used.

Delay in ms before showing the terminals when hovering over an event bar.

Can be used for a more "stable" UI, where the terminals are not shown immediately when hovering over an event bar and thus have fewer things moving when mouse is moved quickly over multiple event bars.

terminalSides: String[]

Where (on event bar edges) to display terminals. The sides are 'start', 'top', 'end' and 'bottom'

Terminal diameter in px, overrides the default CSS value for it (which might depend on theme).

Use an even number to avoid cropped terminals.

Also accepts a string value representing a CSS size, e.g. '1.5em'.

When unset, the value specified in the --b-dependency-terminal-size CSS variable is used.

Properties

8

Class hierarchy

isDependencyCreation: Boolean= truereadonly
Identifies an object as an instance of DependencyCreation class, or subclass thereof.
isDependencyCreation: Boolean= truereadonlystatic
Identifies an object as an instance of DependencyCreation class, or subclass thereof.

Dependency creation

false to require a drop on a target event bar side circle to define the dependency type. If dropped on the event bar, the defaultValue of the DependencyModel type field will be used to determine the target task side.

A template function that will be called to generate the HTML contents of the dependency creation tooltip. You can return either an HTML string or a DomConfig object.

ParameterTypeDescription
dataObject

Data about the dependency being created

data.sourceTimeSpan

The from event

data.targetTimeSpan

The target event

data.fromSideString

The from side (start, end, top, bottom)

data.toSideString

The target side (start, end, top, bottom)

data.validBoolean

The validity of the dependency

Returns: String | DomConfig

Dependency terminals

Delay in ms before hiding the terminals when the mouse leaves an event bar or terminal.

Can be used to make the UI more forgiving, accidentally leaving the event bar or terminal will not immediately hide the terminals.

Can also be used to play a hide animation, set a terminalHideDelay that is longer than your animation's duration. The b-hiding-terminals CSS class is added to the event wrapper while the terminals are being hidden.

Terminal offset from their initial position, in px. Positive values move terminals further away from the event bar, negative values inside the event bar.

When unset, the value specified in the --b-dependency-terminal-offset CSS variable is used.

Delay in ms before showing the terminals when hovering over an event bar.

Can be used for a more "stable" UI, where the terminals are not shown immediately when hovering over an event bar and thus have fewer things moving when mouse is moved quickly over multiple event bars.

terminalSize: Number | StringAlso a config

Terminal diameter in px, overrides the default CSS value for it (which might depend on theme).

Use an even number to avoid cropped terminals.

Also accepts a string value representing a CSS size, e.g. '1.5em'.

When unset, the value specified in the --b-dependency-terminal-size CSS variable is used.

Functions

3

Aborts dependency creation, removes proxy and cleans up listeners

Hide terminals for specified event

ParameterTypeDescription
eventElementHTMLElement

Event element

Show terminals for specified event at sides defined in #terminalSides.

ParameterTypeDescription
timeSpanRecordTimeSpan

Event/task to show terminals for

elementHTMLElement

Event/task element, defaults to using the first element found for the task

Events

8

Fired on the owning Scheduler/Gantt after a dependency drag creation operation finished, no matter to outcome

// Adding a listener using the "on" method
dependencyCreation.on('afterDependencyCreateDrop', ({ source, target, dependency }) => {

});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

dependencyDependencyBaseModel

The created dependency

Fired on the owning Scheduler/Gantt before a dependency creation drag operation starts. Return false to prevent it

// Adding a listener using the "on" method
dependencyCreation.on('beforeDependencyCreateDrag', ({ source }) => {

});
ParameterTypeDescription
sourceTimeSpan

The source task

Fired on the owning Scheduler/Gantt when a dependency drag creation operation is about to finalize

// Adding a listener using the "on" method
dependencyCreation.on('beforeDependencyCreateFinalize', ({ source, target, fromSide, toSide }) => {

});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

fromSidestart | end | top | bottom

The from side (start / end / top / bottom)

toSidestart | end | top | bottom

The to side (start / end / top / bottom)

Fired on the owning Scheduler/Gantt before showing dependency terminals on a task or event. Return false to prevent it

// Adding a listener using the "on" method
dependencyCreation.on('beforeShowTerminals', ({ source }) => {

});
ParameterTypeDescription
sourceTimeSpan

The hovered task

Fired on the owning Scheduler/Gantt when a dependency creation drag operation starts

// Adding a listener using the "on" method
dependencyCreation.on('dependencyCreateDragStart', ({ source }) => {

});
ParameterTypeDescription
sourceTimeSpan

The source task

Fired on the owning Scheduler/Gantt when a dependency drag creation operation succeeds

// Adding a listener using the "on" method
dependencyCreation.on('dependencyCreateDrop', ({ source, target, dependency }) => {

});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

dependencyDependencyBaseModel

The created dependency

Fired on the owning Scheduler/Gantt when asynchronous dependency validation completes

// Adding a listener using the "on" method
dependencyCreation.on('dependencyValidationComplete', ({ source, target, dependencyType, fromSide, toSide }) => {

});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

dependencyTypeNumber

The dependency type, see Type

fromSidestart | end | top | bottom

The side of the source task where the dependency starts

toSidestart | end | top | bottom

The side of the target task where the dependency ends

Fired on the owning Scheduler/Gantt when asynchronous dependency validation starts

// Adding a listener using the "on" method
dependencyCreation.on('dependencyValidationStart', ({ source, target, dependencyType, fromSide, toSide }) => {

});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

dependencyTypeNumber

The dependency type, see Type

fromSidestart | end | top | bottom

The side of the source task where the dependency starts

toSidestart | end | top | bottom

The side of the target task where the dependency ends

Event handlers

8

Called on the owning Scheduler/Gantt after a dependency drag creation operation finished, no matter to outcome

new DependencyCreation({
    onAfterDependencyCreateDrop({ source, target, dependency }) {

    }
});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

dependencyDependencyBaseModel

The created dependency

Called on the owning Scheduler/Gantt before a dependency creation drag operation starts. Return false to prevent it

new DependencyCreation({
    onBeforeDependencyCreateDrag({ source }) {

    }
});
ParameterTypeDescription
sourceTimeSpan

The source task

Called on the owning Scheduler/Gantt when a dependency drag creation operation is about to finalize

new DependencyCreation({
    onBeforeDependencyCreateFinalize({ source, target, fromSide, toSide }) {

    }
});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

fromSidestart | end | top | bottom

The from side (start / end / top / bottom)

toSidestart | end | top | bottom

The to side (start / end / top / bottom)

Called on the owning Scheduler/Gantt before showing dependency terminals on a task or event. Return false to prevent it

new DependencyCreation({
    onBeforeShowTerminals({ source }) {

    }
});
ParameterTypeDescription
sourceTimeSpan

The hovered task

Called on the owning Scheduler/Gantt when a dependency creation drag operation starts

new DependencyCreation({
    onDependencyCreateDragStart({ source }) {

    }
});
ParameterTypeDescription
sourceTimeSpan

The source task

Called on the owning Scheduler/Gantt when a dependency drag creation operation succeeds

new DependencyCreation({
    onDependencyCreateDrop({ source, target, dependency }) {

    }
});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

dependencyDependencyBaseModel

The created dependency

Called on the owning Scheduler/Gantt when asynchronous dependency validation completes

new DependencyCreation({
    onDependencyValidationComplete({ source, target, dependencyType, fromSide, toSide }) {

    }
});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

dependencyTypeNumber

The dependency type, see Type

fromSidestart | end | top | bottom

The side of the source task where the dependency starts

toSidestart | end | top | bottom

The side of the target task where the dependency ends

Called on the owning Scheduler/Gantt when asynchronous dependency validation starts

new DependencyCreation({
    onDependencyValidationStart({ source, target, dependencyType, fromSide, toSide }) {

    }
});
ParameterTypeDescription
sourceTimeSpan

The source task

targetTimeSpan

The target task

dependencyTypeNumber

The dependency type, see Type

fromSidestart | end | top | bottom

The side of the source task where the dependency starts

toSidestart | end | top | bottom

The side of the target task where the dependency ends

CSS variables

16
NameDescription
--b-dependency-terminal-sizeDependency terminal size
--b-dependency-terminal-offsetDependency terminal offset from the event edge, negative values move away from the event
--b-dependency-terminal-z-indexDependency terminal z-index
--b-dependency-terminal-border-widthDependency terminal border width
--b-dependency-terminal-border-styleDependency terminal border style
--b-dependency-terminal-border-colorDependency terminal border color. By default it matches event border color to match its look
--b-dependency-valid-colorColor for a valid dependency line during creation
--b-dependency-invalid-colorColor for an invalid dependency line during creation
--b-dependency-tooltip-valid-header-colorColor used in the header of the dependency creation tooltip when the dependency is valid
--b-dependency-tooltip-valid-header-backgroundBackground used in the header of the dependency creation tooltip when the dependency is valid
--b-dependency-tooltip-invalid-header-colorColor used in the header of the dependency creation tooltip when the dependency is invalid
--b-dependency-tooltip-invalid-header-backgroundBackground used in the header of the dependency creation tooltip when the dependency is invalid
--b-dependency-terminal-colorDependency terminal fill color
--b-dependency-terminal-valid-colorColor for a valid dependency terminal during creation
--b-dependency-terminal-invalid-colorColor for an invalid dependency terminal during creation
Hovered
--b-dependency-terminal-hover-colorDependency terminal hover fill color