onLinkValidation
Description
当用户添加新链接时触发,dhtmlxGantt 会验证该链接是否有效
onLinkValidation: (link: Link) => boolean;
Parameters
link- (required) Link - 该 Link 对象
Returns
result- (boolean) - 定义事件的默认行为是否会被触发(true)还是取消(false)
Example
gantt.attachEvent("onLinkValidation", function(link){
// 在这里插入您的自定义逻辑
});
Details
注释
事件在 isLinkAllowed 方法中触发。
事件在用户通过鼠标拖放在任务之间创建新连线时触发。
如果事件处理程序返回 false,目标任务 的圆形把手将显示为红色,且不会添加连线。返回 true 时,将把圆形把手显示为橙色并允许创建连线。
Related API
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.