In order to render the icon in cells, you need to use onBeforeCellRender:
dp.onBeforeCellRender = function(args) {
if (args.cell.resource === "summary") {
var cell = args.cell;
var duration = new DayPilot.Duration(cell.start, cell.end);
var mid = cell.start.addTime(duration.totalMilliseconds()/2);
cell.areas = [{
start: mid,
offsetX: - 8,
top: 2,
width: 16,
height: 16,
backColor: "red",
}];
}
};
The cells get rendered on every update() call. If you mark the row with cellsAutoUpdated property, all cells from that row will be re-rendered on every event change (drag and drop, events.add/update/remove) as well:
dp.resources = [
{name: "Summary", id: "summary", frozen: "top", cellsAutoUpdated: true},
// ...
];
In some special cases (like window resize with cellWidthSpec: "Auto") the cells will be re-rendered but onBeforeCellRender will not be fired because the results are cached by default. You can turn the caching off for all cells using https://api.daypilot.org/daypilot-scheduler-beforecellrendercaching/ or you can explicitly invalidate the cache for specified cells:
dp.rows.find("summary").cells.all().invalidate();