我正在使用 Angular-Gantt.js 模块开发一个调度应用程序。
它工作正常 - >除了我想自定义标题以显示日视图比例中的列“M,T,W,Th,F ...”。目前它显示像这个演示版本 -->
https://www.angular-gantt.com/demo/ https://www.angular-gantt.com/demo/
从模块的文档来看,在创建和显示标题后而不是在创建标题时触发了一些事件。然而,有一个关于如何编写插件的指南。我想知道是否有人已经解决了这个问题并可以为我指出正确的方向。
非常感谢,
拉维
对的,这是可能的。只需在 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' 等。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)