본문으로 건너뛰기

timeline_cell_class

Description

타임라인 영역의 셀에 적용될 CSS 클래스를 지정합니다

timeline_cell_class: (item: any, date: Date) => string | void;

Parameters

  • item - (필수) Task | 객체 - 행에 할당된 작업의 객체 또는 자원 객체 중 하나
  • date - (필수) Date - 셀의 날짜

Returns

  • text - (string | void) - 해당 항목에 대한 CSS 클래스

Example

<style>
.weekend{ background: #f4f7f4 !important;}
</style>

gantt.templates.timeline_cell_class = function(task,date){
if(date.getDay()==0||date.getDay()==6){
return "weekend";
}
};

Details

Note that while using work time calculations, you can use isWorkTime instead of hardcoded values:

gantt.config.work_time = true;

gantt.templates.timeline_cell_class = function(task,date){
if(!gantt.isWorkTime({task:task, date:date}))
return "weekend";
};
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.