ightbox:{sections:[{name:"description", height:200, map_to:"text", type:"textarea", focus:!0},
时间: 2023-11-08 08:04:44 浏览: 41
根据引用,"editable_property"是指任务数据对象的属性,而不是灯箱部分或左侧网格的列。如果要使其可从灯箱设置,需要将"editable_property"设置为控件映射到的同一属性。例如,使用以下代码将"editable_property"设置为"some_property":
gantt.config.lightbox.sections = [
{ name:"description", height:38, map_to:"some_property", type:"textarea", focus:true },
....
];
gantt.config.editable_property = "some_property";
根据引用,"readonly"属性不会阻止通过API方法实现的操作。如果你希望在只读模式下禁用特定操作,可以在回调函数中手动检查是否启用了只读模式。例如,以下是如何在单击自定义按钮时阻止添加任务的功能:
gantt.config.readonly = true;
gantt.config.columns = [
{ name: "text", label: "Task name", width: "*", tree: true },
{ name: "start_date", label: "Start time", align: "center" },
{ name: "duration", label: "Duration", align: "center" },
{ name: "add", label: "1", width: 44 },
{ name: "add_custom", label: "2", width: 44, template: function (task) { return "<div class='custom_add' οnclick='customAdd(" + task.id + ")';></div>" } }
];
function customAdd(parentId) {
if (gantt.config.readonly){
return;
}
}
根据引用[3],如果您想为只读任务显示灯箱,可以使用"gantt.showLightbox(id)"手动调用它。例如,以下代码在双击任务时显示灯箱:
gantt.attachEvent("onTaskDblClick", function(id,e){
gantt.showLightbox(id)
return true;
});
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)