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
    })


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM