search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Different CellDuration for scheduler cells and header

Asked by Mauricio Farinelli
10 years ago.

Hi,

In our scheduler, we wanted to be able to resize events with 15 min accuracy, but we want to keep our header as it is, each 4 hours

I am able to do it if I override the this._prepareHeaderGroups method.

However, I'd like to know if there is a natively way to have CellDuration of 240 for our header, and 15 for our scheduler cells?

Thanks

Answer posted by Dan Letecky [DayPilot]
10 years ago.

It's possible to insert custom segments into the time headers cells using time-based active areas.

This technique is used in the following demo to split a month into thirds:
http://javascript.daypilot.org/demo/scheduler/timeheaderactiveareas.html

dp.onBeforeTimeHeaderRender = function(args) {
  if (args.header.level === 1) {
      var point1 = args.header.start.addDays(10);
      var point2 = args.header.start.addDays(20);
      args.header.areas = [
          {start: args.header.start, end: point1, top: 0, bottom: 0, backColor: "rgba(0, 255, 0, .4)", html: "1st third"},
          {start: point1, end: point2, top: 0, bottom: 0, backColor: "rgba(255, 0, 0, .4)", html: "2nd third"},
          {start: point2, end: args.header.end, top: 0, bottom: 0, backColor: "rgba(255, 255, 255, .4)", html: "3rd third"},
      ];

      args.header.html = "";
  }
};

You can use the same technique to split a day into 4-hour blocks.

Comment posted by Mauricio Farinelli
10 years ago.

Thanks a lot.
That is what we need

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.