第一次接觸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 })