onLightboxSave
Description
当用户点击 lightbox 中的"保存"按钮时触发
onLightboxSave: (id: string | number, task: Task, is_new: boolean) => boolean;
Parameters
id- (required) string | number - 未修改任务的 ID。请注意,此时 lightbox 中的值尚未应用到任务对象,因此您可以通过 gantt.getTask(id) 访问原始任务task- (required) Task - 更新后的任务对象is_new- (required) boolean - 指示 lightbox 是用于创建新任务(true)还是编辑现有任务(false)
Returns
result- (boolean) - 决定默认事件操作是否继续执行(true)或取消(false)
Example
gantt.attachEvent("onLightboxSave", function(id, task, is_new){
// 可以在这里添加自定义逻辑
return true;
})
Details
此事件可以被阻止。返回 false 将取消"保存"操作并保持 lightbox 打开状态。
Related Guides
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.