跳到主要内容

silent

Description​

使其中的所有代码不触发内部事件或服务器端调用

silent: (callback: GanttCallback) => void

Parameters​

  • callback - (必需)function - 回调函数

Example​

gantt.silent(function () {
// 任务仅在客户端被删除
// gantt 不会自动重绘
gantt.deleteTask(id);
});

// 准备好后手动重绘 gantt
gantt.render();

Details​

在 silent() 内移动任务(例如使用 moveTask() 或更改其父级),不会触发 onBeforeTaskMove 和 onAfterTaskMove 事件,不会被添加到撤销历史中,也不会发送到服务器。

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.