简体   繁体   中英

DHTMLX Scheduler Block/Mark employee hours on Timeline?

I am using the Timeline in somewhat of an unconventional way. I have the typical day and week event/tasks working fine but I need an hour summary for the week. I cannot get marking/blocking to work for the life of me. The picture example on the bottom of this page gets it correct ( http://docs.dhtmlx.com/scheduler/limits.html ) but where do the IDs come from?

scheduler.addMarkedTimespan({  
    days:  [0,3], 
    zones: "fullday",
    css:   "green", 
    sections: { timeline: 2} 
});

To further explain, we have employees Sally, Bob and Jerry. Let's say Sally worked 7, 8, 9, 4, 8 hours from the beginning of the week, Bob worked 8,9,8,8,9 and Jerry was off all week (so 0,0,0,0,0). If they worked 8 hours, the cell should be yellow, if over 8 green, and under 8 red. I'd also like to display the number in the cell. These can be disabled or not, events will not be allowed on the Hours timeline. Any help is greatly appreciated, as I've been stuck on this for a while. http://jsfiddle.net/Ld9vZ/24/

The best way to do this is to switch timeline to Cell mode (you should set render: 'cell' in the timeline config).

To change cells background colors and text you can overwrite scheduler.templates.timeline_cell_class and scheduler.templates.timeline_cell_value methods. (see http://docs.dhtmlx.com/scheduler/timeline_view_templates.html )

You can see example here: http://docs.dhtmlx.com/scheduler/snippet/6be2d971

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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