dhtmlxGant(甘特图)用法和配置

第一次接触dhtmlxGant(甘特图)我是很懵的,然后我就疯狂的百度,也找到对应功能的博客

1,适合第一次接触dhtmlxGant, 0教学(讲的非常细):https://blog.csdn.net/honantic/article/details/51314672

2,关于配置当然是dhtmlxGant官网啦,它里面有很多功能的配置:https://docs.dhtmlx.com

然后是我搜到的博客:https://www.cnblogs.com/wofeiliangren/p/11678297.html

3,dhtmlxGant使用工具栏:https://docs.dhtmlx.com/suite/toolbar__common_methods.html#checkingifatoolbaritemisdisabled (官网)

我用的是自定义工具栏

gantt.templates.tooltip_text = function (start, end, task) {
      return '<b>任务名称:</b> ' + task.text + '<br/><b>工期:</b> ' + task.duration
    }

我在开发中遇到的问题是没有监测到鼠标已经离开包裹着ghtml的div

解决方案是:

 gantt.ext.tooltips.tooltipFor({
      selector: '.gantt_grid [' + gantt.config.task_attribute + ']',
      // html: (event) => {
      //   if (gantt.config.touch && !gantt.config.touch_tooltip) {
      //     return
      //   }

      //   const targetTaskId = gantt.locate(event)
      //   if (gantt.isTaskExists(targetTaskId)) {
      //     const task = gantt.getTask(targetTaskId)
      //     return gantt.templates.tooltip_text(task.start_date, task.end_date, task)
      //   }
      //   return null
      // },
      global: true
    })
posted @ 2020-04-08 16:57  要开心鸭丫  阅读(3145)  评论(0编辑  收藏  举报