drag_link_class
Description
Specifies the CSS class that will be applied to the pop-up that appears when a user drags a link
drag_link_class: (from: string | number, from_start: boolean, to: string | number, to_start: boolean) => string | void;
Parameters
from- (required) string | number - the id of the source taskfrom_start- (required) boolean - true, if the link is being dragged from the start of the source task, false - if
from the end of the taskto- (required) string | number - the id of the target task( 'null' or 'undefined', if the target task isn't specified yet)to_start- (required) boolean - true, if the link is being dragged to the start of the target task, false - if
to the end of the task
Returns
text- (string | void) - a CSS class for the item in question
Example
gantt.templates.drag_link_class = function(from, from_start, to, to_start) {
let add = "";
if(from && to){
const allowed = gantt.isLinkAllowed(from, to, from_start, to_start);
add = (allowed ? "gantt_link_allow" : "gantt_link_deny");
}
return `gantt_link_tooltip ${add}`;
};