简体   繁体   English

如何创建像视图一样的资源时间线,但用于 dayGridView?

[英]How to create a resource timeline like view, but for dayGridView?

I'm trying to build a view similar to the picture below.我正在尝试构建类似于下图的视图。 I have tried resourceDayGrid view, but this one places the resources as columns instead of rows.我尝试过 resourceDayGrid 视图,但是这个视图将资源作为列而不是行。 I have also tried the resourceTimelineDay, resourceTimelineWeek and resourceTimelineMonth and setting slotDuration: "24:00:00", but this doesn't do it for me since the slots that aren't 24 hours don't take fullwidth of the cell.我也尝试过 resourceTimelineDay、resourceTimelineWeek 和 resourceTimelineMonth 并设置 slotDuration:"24:00:00",但这对我不起作用,因为不是 24 小时的插槽不占用单元格的全角。

Example:例子:

views:{
  resourceTimelineMonth:{
    duration: { days:7 },
    slotDuration:'24:00:00'
  },
  resourceTimelineWeek:{
    duration: { days:7 },
    slotDuration:'24:00:00'
  },
  resourceTimelineDay:{
    duration: { days:7 },
    slotDuration:'24:00:00'
  }
},

https://codepen.io/tuancaraballo/pen/poJrwLy?editable=true&editors=001 https://codepen.io/tuancaraballo/pen/poJrwLy?editable=true&editors=001

Do you have any suggestions?你有什么建议吗? I would appreciate if you can point me in the right direction.如果您能指出我正确的方向,我将不胜感激。

Thank you in advance.先感谢您。

在此处输入图片说明

It makes no sense to declare "resourceTimelineMonth" and then set its duration to 7 days.声明“resourceTimelineMonth”然后将其持续时间设置为 7 天是没有意义的。 The same for "resourceTimelineDay". “resourceTimelineDay”也是如此。 Its duration is defined already by its name.其持续时间已由其名称定义。 Equally you don't need to bother setting the duration of a resuorceTimelineWeek to 7 days - it already is!同样,您无需费心将 resuorceTimelineWeek 的持续时间设置为 7 天——它已经是了!

And to make events stretch the whole width, you should define the slotDuration in days instead of hours.并且要使事件拉伸整个宽度,您应该以天而不是小时为slotDuration定义slotDuration

So you can simplify your view definitions to this:因此,您可以将视图定义简化为:

views:{
    resourceTimelineWeek: {
      slotDuration: { days: 1 }
    }
},

Demo: https://codepen.io/ADyson82/pen/LYVjLMB演示: https : //codepen.io/ADyson82/pen/LYVjLMB

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM