跳到主要内容

onScaleAdjusted

Description

当比例尺重新渲染以完整显示所有任务时触发

onScaleAdjusted: () => void;

Example

gantt.attachEvent("onScaleAdjusted", function(){
const min = gantt.getState().min_date;
const max = gantt.getState().max_date;
const to_str = gantt.templates.task_date;

return gantt.message(`Scale shows days from ${to_str(min)}
to ${to_str(max)}`);
});

Details

请注意,只有当 fit_tasks 属性被设置为 true 时,事件才会触发。

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.