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

Cell customize

Asked by Ilan
4 years ago.

I'm trying to make an hotel scheduler and I want to add small icons representing the status of the room on the empty cells (not reservation and not room line header). what is the best way? I try to use the 'onBeforeCellRender' function but I don't have the information of the cells (after render). thanks

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

I'm not sure if this is exactly what you are looking for but you can get a list of events the overlap a given cell in onBeforeCellRender using args.cell.events().

See also:
https://api.daypilot.org/daypilot-scheduler-onbeforecellrender/

And a related demo (this doesn't use args.cell.events() but args.cell.utilization() to calculate total cell utilization based on the events):
http://javascript.daypilot.org/demo/scheduler/resourceutilization.html

If need, you can also access the row data using args.cell.resource in onBeforeCellRender:

dp.onBeforeCellRender = function(args) {
  var row = dp.rows.find(args.cell.resource);
  var events = args.cell.events();
  // ...
};

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