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

DayPilot Pro for JavaScript 8.1 - Active Areas examples

Asked by Albert Ritmeester
8 years ago.

I am looking for examples of two new features:

  • Time-Positioned Active Areas (Scheduler)
  • Active Areas for Grid Cells (Scheduler)

I already have found the demo for Active Areas for Time Headers (Scheduler) so my question is on grid cells

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

You can take a look at the following demo:

http://javascript.daypilot.org/demo/scheduler/eventareas.html

It adds a green active area to the current day using onBeforeCellRender:

dp.onBeforeCellRender = function(args) {
  var today = DayPilot.Date.today();
  var todayEnd = today.addDays(1);

  if (DayPilot.Util.overlaps(args.cell.start, args.cell.end, today, todayEnd)) {
      args.cell.properties.areas = [{
          start: DayPilot.Date.today(),
          end: DayPilot.Date.today().addHours(12),
          top:0,
          bottom:5,
          backColor: "green"
      }];
  }
};

It uses "start" and "end" properties instead of left/right/width.

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