removeRowAndGroupByKey method

  1. @override
  2. @protected
void removeRowAndGroupByKey(
  1. Iterable<Key> keys
)
inherited

Implementation

@override
@protected
void removeRowAndGroupByKey(Iterable<Key> keys) {
  if (keys.isEmpty) {
    return;
  }

  assert(enabledRowGroups);

  bool removeEmptyGroup(PlutoRow row) =>
      rowGroupDelegate!.type.isByColumn &&
      row.type.group.children.originalList.isEmpty;

  _ensureRowGroups(() {
    bool removeAll(PlutoRow row) {
      if (row.type.isGroup) {
        row.type.group.children.removeWhereFromOriginal(removeAll);

        if (removeEmptyGroup(row)) return true;
      }

      return keys.contains(row.key);
    }

    refRows.removeWhereFromOriginal(removeAll);
  });
}