Skip to main content

onLinkValidation

Description

Fires when the user adds a new link and dhtmlxGantt checks whether the link is valid

onLinkValidation: (link: Link) => boolean;

Parameters

  • link - (required) Link - the link object

Returns

  • result - (boolean) - defines whether the default action of the event will be triggered (true) or cancelled (false)

Example

gantt.attachEvent("onLinkValidation", function(link){
//any custom logic here
});

Details

note

The event fires in the isLinkAllowed method.

The event fires when a user creates a new link between tasks by drag-and-drop with the mouse.

If the event handler returns false, the round handler of the target task will be colored in red and the link won't be added. Returning true will highlight the round handler in orange and allow creation of a link.