作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
虽然可以通过 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/
虽然可以通过 date_scale 更改 x 刻度日期格式从模板来看,它在 Angular 中不起作用。我添加基于 this tutorial 的指令,然后添加以下代码: gantt.template
我是一名优秀的程序员,十分优秀!