跳到主要内容

isSelectedTask

Description

检查指定任务当前是否被选中

isSelectedTask: (task: string | number) => boolean

Parameters

  • task - (required) string | number - 该任务的 id

Returns

  • value - (boolean) - 若指定任务当前被选中,则返回 'true',否则返回 'false'

Example

gantt.templates.task_class = 
gantt.templates.grid_row_class =
gantt.templates.task_row_class = function (start, end, task) {
if (gantt.isSelectedTask(task.id))
return "gantt_selected";
};

Details

注释

此方法在 multiselect 扩展中定义,因此需要启用 multiselect 插件。请在 多任务选择 文章中阅览详细信息。

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.