gpt4 book ai didi

javascript - Dhtmlx date_scale 从未在 Angular 中被调用过?

转载 作者:行者123 更新时间:2023-12-03 02:02:50 25 4
gpt4 key购买 nike

虽然可以通过 date_scale 更改 x 刻度日期格式从模板来看,它在 Angular 中不起作用。我添加基于 this tutorial 的指令,然后添加以下代码:

gantt.templates.date_scale = function(date){
return gantt.date.date_to_str(gantt.config.date_scale)(date);
};

但是,该方法从未被调用。

最佳答案

这是 DHTMLX 甘特图 ( https://forum.dhtmlx.com/viewtopic.php?f=15&t=32888&p=141311&hilit=gantt.templates.date_scale#p141311 ) 中的错误。到目前为止,这个错误尚未修复,但正如您在提到的链接(这是来自他们的论坛的链接)中看到的,有一个技巧。您可以使用如下事件来获得您想要的:

gantt.attachEvent("onTemplatesReady", function() {
gantt.templates.date_scale = function(
return gantt.date.date_to_str("%Y, %F %j")(date);
};

gantt.templates.scale_cell_class = function(date){
return "newWidth";
};
});

关于javascript - Dhtmlx date_scale 从未在 Angular 中被调用过?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49937015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com