跳到主要内容

tooltip_text

Description

设置在tooltip中显示的文本

tooltip_text: (start: Date, end: Date, task: Task) => string | void;

Parameters

  • start - (required) Date - 任务计划开始的日期
  • end - (required) Date - 任务计划结束的日期
  • task - (required) Task - 任务对象

Returns

  • text - (string | void) - 将在gantt tooltip中显示的HTML字符串

Example

gantt.templates.tooltip_text = function(start,end,task){
return "<b>Task:</b> "+task.text+"<br/><b>Start date:</b> " +
gantt.templates.tooltip_date_format(start)+
"<br/><b>End date:</b> "+gantt.templates.tooltip_date_format(end);
};

Details

注释

该模板是tooltip扩展的一部分,因此必须启用tooltip插件。更多详情请参见Gantt 元素的工具提示文章。