Перейти к основному содержимому

timeline_cell_class

Description

Указывает CSS-класс, который будет применяться к ячейкам области временной шкалы

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

Parameters

  • item - (required) Task | object - либо объект задачи или ресурса, привязанный к строке
  • date - (required) 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.