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

Re-Calculate Totals row when a row is deleted

Asked by AK
1 year ago.

I am trying to update the totals row (Scheduler) when a resource is deleted from DP. The totals row updates fine when an event is deleted or a row is added to the DP table. The only issue I am having is that it doesn't update when I remove a row from the DP scheduler table.

I am calculating my totals row by using the onBeforeCellRender function as shown in this link:

Would you know of any function that would help me achieve this? Or maybe I am doing something wrong because it seems like every time I delete a row, array should be updated as well and maybe then the onBeforeCellRender will update the totals row?

Comment posted by WSJU
1 year ago.

I meant totals of individual columns shown in a row. So when a resource is deleted, the totals would need to be re-calculated based on new set of resources.

Comment posted by WSJU
1 year ago.

Example is shown here for rows but I would like to do it for columns.

Answer posted by Dan Letecky [DayPilot]
1 year ago.

The cells in rows marked with "cellsAutoUpdated: true" will be updated on every change, including a row removal.

You might want to review and update the calculation logic. The tutorial ( uses events.forRange() method to find all events for a range:

var events =, args.cell.end);

The current implementation of events.forRange() returns all events in events.list, regardless of the resource.

To include only events from visible rows, you will need to change the the logic. Example:

let events = [];
dp.rows.all().forEach(r => {
  const eventsFromThisRow =, args.cell.end);
  events = events.concat(eventsFromThisRow);
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.