       @setRowData event.parent_id, 'deletedChildren', deletedChildren
       for ancestor_id in @api.view.data.allAncestors event.id, { inclusive: false }
         @_rebuildTreeTimes ancestor_id
+
     onRowAdded: (event) ->
       deletedChildren = (@getRowData event.parent_id, 'deletedChildren') ? {}
       if event.id of deletedChildren

        current
      @_addTimeToRow period.row, period.time, period.stop
      @_addTimeToAncestors period.row, period.time, period.stop
    onDescendantRemoved: (event) ->
      @logger.debug "Descendant #{event.descendantId} removed from #{event.ancestorId}"
      # Could avoid lookups by knowing exact changes, if needed
      @_rebuildTreeTimes event.ancestorId
    onDescendantAdded: (event) ->
      @logger.debug "Descendant #{event.descendantId} added to #{event.ancestorId}"
      # Could avoid lookups by knowing exact changes, if needed

          current ?= {}
          current[key] = (current[key] ? 0) + time
          current

    _rebuildTreeTimes: (id) ->
      children = @api.view.data._getChildren id
      deletedChildren = (@getRowData id, 'deletedChildren') ? {}

      childTotalTimes = _.map children, (child_id) => @getRowData child_id, "treeTotalTime"
      rowTotalTime = @getRowData id, "rowTotalTime"
      deletedChildrenTotalTimes = _.map deletedChildren, (x) -> x['totalTime']
      totalTimes = _.compact [rowTotalTime].concat(childTotalTimes).concat(deletedChildrenTotalTimes)
      totalTime = sum totalTimes
      @setRowData id, "treeTotalTime", totalTime

      childDailyTimes = _.map children, (child_id) => @getRowData child_id, "treeDailyTime"
      rowDailyTime = @getRowData id, "rowDailyTime"
      deletedChildrenDailyTimes = _.map deletedChildren, (x) -> x['totalTime']
      dailyTimes = _.compact [rowDailyTime].concat(childDailyTimes).concat(deletedChildrenDailyTimes)
      dailyTime = @_combineDailyTimes.apply @, dailyTimes
      @setRowData id, "treeDailyTime", dailyTime
