我正在使用 Angular-Gantt.js 模块开发一个调度应用程序。 它工作正常 ->除了我想自定义标题以显示日 View 比例中的列“M,T,W,Th,F ...”。目前它显示像这个演示版本 -->
https://www.angular-gantt.com/demo/
根据模块的文档,在创建和显示 header 之后而不是在创建 header 时会触发一些事件。然而,有一个关于如何编写插件的指南。我想知道是否有人解决了这个问题并可以为我指出正确的方向。
非常感谢, 拉维
最佳答案
是的,这是可能的。只需在 html 中的甘特指令上添加 headers-formats 选项,并将以下代码添加到 $scope.option 中:
In the html:
<div gantt
header-formats="options.headersFormats">
<div>
In the controller:
$scope.option: {
//other options
headersFormats: {
'year': 'YYYY',
'quarter': '[Q]Q YYYY',
month: 'MMMM YYYY',
week: function(column) {
return column.date.format('MMM D [-]') + column.endDate.format('[ ]MMM D');
},
day: 'ddd',
hour: 'H',
minute:'HH:mm'
},
}
将 headersFormats 的 'day' 属性设置为 'ddd' 将使日期显示为 'Mon', 'Tue', 'Wed' 等
关于angularjs - Angular-Gantt - 可以将日期标题更改为 'M,T,W,Th ...' 而不是日期吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27436685/