onLightboxSave
Description
当用户在灯箱中点击“保存”按钮时触发
onLightboxSave: (id: string | number, task: Task, is_new: boolean) => boolean;
Parameters
id- (required) string | number - 未修改任务的 id。请注意,在此阶段灯箱中的值尚未应用到任务对象中,您可以通过 gantt.getTask(id) 访问初始任务task- (required) Task - 修改后的任务对象is_new- (required) boolean - 指定用户是否打开灯箱以创建新任务 (true)
或更新现有任务 (false)
Returns
result- (boolean) - 定义事件的默认操作是否会被触发 (true) 或取消 (false)
Example
gantt.attachEvent("onLightboxSave", function(id, task, is_new){
// 在这里插入您的自定义逻辑
return true;
})
Details
该事件是可阻塞的。返回 false 以取消“保存”操作并保持灯箱打开。
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.