跳到主要内容

buttons_right

Description

在 lightbox 的右下角驻留的一组按钮集合

buttons_right: string[]

Example

<style>
.complete_button{
margin-top: 2px;
background-image:url("common/v_complete.png");
width: 20px;
}
</style>
<script>
gantt.locale.labels["complete_button"] = "Complete";
gantt.attachEvent("onGanttReady", function(){ /*!*/
gantt.config.buttons_right = ["gantt_delete_btn","complete_button"]; /*!*/
}); /*!*/
gantt.init("gantt_here");

gantt.attachEvent("onLightboxButton", function(button_id, node, e){
if(button_id == "complete_button"){
var id = gantt.getState().lightbox;
gantt.getTask(id).progress = 1;
gantt.updateTask(id);
gantt.hideLightbox();
}
});
</script>

默认值: ["gantt_delete_btn"]

Details

注释

请注意,如果您使用 Material skin,它将重新定义按钮配置。 要防止这种情况,您需要在 onGanttReady 事件处理程序中指定按钮的配置。

property_buttons_left

你可以在初始化 Gantt 之前,用以下语法更新右侧按钮的标签:

gantt.locale.labels.icon_delete= "New Label";

gantt.init("gantt_here");

或者,你也可以在 Gantt 初始化后这样修改标签:

gantt.attachEvent("onGanttReady", function(){
gantt.locale.labels.gantt_delete_btn = "New Label";
});

从版本 7.0 开始,也可以通过 i18n 对象来更改标签:

gantt.i18n.setLocale({
labels: {
gantt_delete_btn: "New Label"
}
});
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.