当timeline为空时显示背景grid
gantt.config.timeline_placeholder = false;
...
gantt.init("gantt_here");
当Gantt中没有加载任何任务时,timeline中会显示背景grid:
如果包含任务的行没有覆盖整个timeline,也会显示背景grid:
为了突出显示背景grid中的列和单元格,可以使用 timeline_cell_class 模板:
gantt.templates.timeline_cell_class = function (task, date) {
if (!gantt.isWorkTime({ date: date, task: task })) {
return "weekend";
}
};
对于背景行,会传入一个临时的task对象给模板。可以通过其id来识别该对象:
if(task.id === "timeline_placeholder_task"){
...
}
added in v8.0
Back to top