项目管理软件dhtmlxGantt配置教程(十五):突出展示时间段

本文给大家讲解dhtmlxGantt如何突出展示时间段。

为了让用户注意特定的时间段,您可以突出显示它们。

  • 要突出显示时间线区域的单元格,请使用timeline_cell_class模板。
  • 要突出显示时间线时间刻度的单元格,请使用scale_cell_class模板。

模板是一个函数,它遍历所有日期并将指定的 CSS 类应用于相关单元格。

项目管理软件dhtmlxGantt配置教程(十五):突出展示时间段

例如,您可以突出显示周末以直观地将比例划分为周:

<style>.weekend{ background: #f4f7f4 !important;}</style>gantt.templates.scale_cell_class = function(date){    if(date.getDay()==0||date.getDay()==6){        return "weekend";    }};gantt.templates.timeline_cell_class = function(task,date){    if(date.getDay()==0||date.getDay()==6){        return "weekend" ;    }};gantt.init("gantt_here");

请注意,在使用工作时间计算时,您可以使用isWorkTime而不是硬编码值:

gantt.config.work_time = true;gantt.templates.scale_cell_class = function(date){    if(!gantt.isWorkTime(date)){        return "weekend";    }};gantt.templates.timeline_cell_class = function(task,date){    if(!gantt.isWorkTime({task:task, date:date})){        return "weekend" ;    }};gantt.init("gantt_here");

dhtmlxGantt享有超十年声誉,支持跨浏览器和跨平台,性价比高,可满足项目管理控件应用的所有需求,是最完善的甘特图图表库。了解更多内容,欢迎在线咨询或者私信我获取正版试用版及报价。


甘特图控件交流群:764148812    欢迎进群交流讨论

年终狂欢季,全场产品,限时特惠,立即了解详情!

标签:

来源:慧都网

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2022年9月21日
下一篇 2022年9月22日

相关推荐

发表回复

登录后才能评论