跳到主要内容

isReadonly

Description

检查指定的任务/链接,或整个甘特图是否为只读

isReadonly: (item?: number | string | Task | Link) => boolean

Parameters

  • item - (optional) number | string | Task | Link - 可选,任务/链接的 ID 或对象。若未指定,该方法将检查甘特图是否为只读

Returns

  • mode` - (boolean) - true,如果任务/链接,或甘特图为只读。否则,false

Example

gantt.addTask({
id:10,
text:"Task #5",
start_date:"02-09-2023",
duration:28
}, "project_2");

gantt.isReadonly(10); // ->false

// 或者
gantt.isReadonly(gantt.getTask(10)); // -> false
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.