# Class Group

### 方法

collapse()Group收起此群组。
expand()Group展开此群组。
getControlIndex()Integer返回该组的控制切换索引。
getDepth()Integer返回此组的深度。
getRange()Range返回此组所在的范围。
isCollapsed()Boolean如果该组已收起，则返回 true
remove()void从工作表中移除该组，从而将 range 的组深度减少 1 次。

## 详细文档

### collapse()

var range = sheet.getRange(2:3);
range.shiftRowGroupDepth(1);
var group = sheet.getRowGroup(2, 1);

// Collapses this group.
group.collapse();

Group - 此群组，用于串联

### expand()

var range = sheet.getRange(2:3);
range.shiftRowGroupDepth(1);
var group = sheet.getRowGroup(2, 1);

// Expands this group.
group.expand();

Group - 此群组，用于串联

### getControlIndex()

sheet.setRowGroupControlAfter(true);
var range = sheet.getRange(2:3);
range.shiftRowGroupDepth(1);
var group = sheet.getRowGroup(2, 1);

// Returns 4
var controlIndex = group.getControlIndex();

#### 弃踢回攻

Integer - 此群组的控制切换索引

### getDepth()

var range = sheet.getRange(2:3);
range.shiftRowGroupDepth(1);
var group = sheet.getRowGroup(2, 1);

// Returns 1 if the group is at depth 1.
var depth = group.getDepth();

Integer - 此群组的深度

### getRange()

var range = sheet.getRange(2:3);
range.shiftRowGroupDepth(1);
var group = sheet.getRowGroup(1, 1);

// Returns the range 2:3 if the group is over rows 2:3
range = group.getRange();

Range - 群组所属的范围

### isCollapsed()

var range = sheet.getRange(2:3);
range.shiftRowGroupDepth(1);
var group = sheet.getRowGroup(2, 1);

// Returns true if the group is collapsed.
var isCollapsed = group.isCollapsed();

#### 弃踢回攻

Boolean - 如果此群组已收起，则返回 true；否则返回 false

### remove()

var range = sheet.getRange(2:3);
range.shiftRowGroupDepth(1);
var group = sheet.getRowGroup(2, 1);

// Removes this group
var range = group.remove();

#### 另请参阅

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"没有我需要的信息" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"太复杂/步骤太多" },{ "type": "thumb-down", "id": "outOfDate", "label":"内容需要更新" },{ "type": "thumb-down", "id": "translationIssue", "label":"翻译问题" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"示例/代码问题" },{ "type": "thumb-down", "id": "otherDown", "label":"其他" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"易于理解" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"解决了我的问题" },{ "type": "thumb-up", "id": "otherUp", "label":"其他" }]