getRootEntity method

TSelectionEntity getRootEntity(
  1. TSelectionEntity rootEntity
)

Implementation

TSelectionEntity getRootEntity(TSelectionEntity rootEntity) {
  if (rootEntity.parent == null ||
      rootEntity.parent!.maxSelectedCount ==
          TSelectionConstant.maxSelectCount) {
    return rootEntity;
  } else {
    return getRootEntity(rootEntity.parent!);
  }
}