# Group

**Kind**: interface | **Module**: [Workspaces](https://docs.interop.io/desktop/reference/javascript/workspaces/index.md)

**Source**: https://docs.interop.io/desktop/reference/javascript/workspaces/group/index.html

An object describing a group type workspace box

## Properties

- **`allowDrop`** (`boolean`, optional)
  Indicates if dropping windows inside this box is allowed
- **`allowDropBottom`** (`boolean`, optional)
  Controls the users ability to drop windows in the bottom zone of the group
- **`allowDropHeader`** (`boolean`, optional)
  Controls the users ability to drop windows in header zone of the group
- **`allowDropLeft`** (`boolean`, optional)
  Controls the users ability to drop windows in the left zone of the group
- **`allowDropRight`** (`boolean`, optional)
  Controls the users ability to drop windows in the right zone of the group
- **`allowDropTop`** (`boolean`, optional)
  Controls the users ability to drop windows in the top zone of the group
- **`allowExtract`** (`boolean`, optional)
  Controls the users ability to extract windows from the group
- **`allowReorder`** (`boolean`, optional)
  Controls the users ability to reorder windows in the group
- **`children`** (`WorkspaceElement[]`, required)
  A collection containing the immediate children of this box
- **`frame`** (`Frame`, required)
  An object representing the frame containing this box
- **`frameId`** (`string`, required)
  The unique string identifier of the frame containing this box
- **`height`** (`number`, optional)
  Returns the current height of the box, can be undefined if the API is used with old versions of Enterprise or Core
- **`id`** (`string`, required)
  An unique string identifier of this box
- **`isMaximized`** (`boolean`, optional)
  Returns whether or not the box is maximized
- **`maxHeight`** (`number`, optional)
  Returns the maximum height of the box, calculated by the size constraints of the elements inside it
- **`maxWidth`** (`number`, optional)
  Returns the maximum width of the box, calculated by the size constraints of the elements inside it
- **`minHeight`** (`number`, optional)
  Returns the minimum height of the box, calculated by the size constraints of the elements inside it
- **`minWidth`** (`number`, optional)
  Returns the minimum width of the box, calculated by the size constraints of the elements inside it
- **`parent`** (`Workspace | WorkspaceBox`, required)
  An object representing this box's parent
- **`positionIndex`** (`number`, required)
  An number representing the positing of this box relative to it's siblings
- **`showAddWindowButton`** (`boolean`, optional)
  Controls the visibility of the add window buttons (the ones with the plus icon) located in the group header
- **`showEjectButton`** (`boolean`, optional)
  Controls the visibility of the eject button located in the group header
- **`showMaximizeButton`** (`boolean`, optional)
  Controls the visibility of the maximize/restore button located in the group header
- **`type`** (`"group"`, required)
- **`width`** (`number`, optional)
  Returns the current width of the box, can be undefined if the API is used with old versions of Enterprise or Core
- **`workspace`** (`Workspace`, required)
  An object representing the workspace containing this box
- **`workspaceId`** (`string`, required)
  The unique string identifier of the workspace containing this box

## Methods

### addColumn

Adds a new column box to this box.

```ts
(definition?: BoxDefinition | BoxBuilder) => Promise<Column>
```

**Parameters**

- **`definition`** (`BoxDefinition | BoxBuilder`, optional)
  An object describing the type of the requested builder, alongside other settings.

**Returns**: `Promise<Column>`

### addGroup

Adds a new group box to this box.

```ts
(definition?: BoxDefinition | BoxBuilder) => Promise<Group>
```

**Parameters**

- **`definition`** (`BoxDefinition | BoxBuilder`, optional)
  An object describing the type of the requested builder, alongside other settings.

**Returns**: `Promise<Group>`

### addRow

Adds a new row box to this box.

```ts
(definition?: BoxDefinition | BoxBuilder) => Promise<Row>
```

**Parameters**

- **`definition`** (`BoxDefinition | BoxBuilder`, optional)
  An object describing the type of the requested builder, alongside other settings.

**Returns**: `Promise<Row>`

### addWindow

Opens a new window inside this box and loads it's content.

```ts
(definition: WorkspaceWindowDefinition) => Promise<WorkspaceWindow>
```

**Parameters**

- **`definition`** (`WorkspaceWindowDefinition`, required)
  An object describing the requested window.

**Returns**: `Promise<WorkspaceWindow>`

### bundleToColumn

Changes the parent of the group to a new column that is added in the place of the group

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### bundleToRow

Changes the parent of the group to a new row that is added in the place of the group

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### close

Closes this box all of it's children.

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### lock

Locks the group using a provided config object, which restricts various modification functionalities of the group

```ts
(config?: GroupLockConfig | ((config: GroupLockConfig) => GroupLockConfig)) => Promise<void>
```

**Parameters**

- **`config`** (`GroupLockConfig | ((config: GroupLockConfig) => GroupLockConfig)`, optional)
  This can be either an object or a function. When the object is provided, it overrides all other lock properties. When a function is provided, it will be called with the current lock settings and it should return a lock config, which will override the current settings. The function is recommended in all cases where overriding of the settings is not desired.

**Returns**: `Promise<void>`

### maximize

Maximizes this box relative to it's parent box.

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### onLockConfigurationChanged

Notifies when a change in the lock configuration of the group has been made

```ts
(callback: (config: IOConnectWorkspaces.GroupLockConfig) => void) => Promise<IOConnectWorkspaces.Unsubscribe>
```

**Parameters**

- **`callback`** (`(config: IOConnectWorkspaces.GroupLockConfig) => void`, required)
  Callback function to handle the event. Receives the new lock configuration as a parameter

**Returns**: `Promise<IOConnectWorkspaces.Unsubscribe>`

### removeChild

Removes the first immediate child of this box which satisfies the predicate.

```ts
(predicate: (child: WorkspaceElement) => boolean) => Promise<void>
```

**Parameters**

- **`predicate`** (`(child: WorkspaceElement) => boolean`, required)
  A filtering function (predicate) called for immediate child of this box.

**Returns**: `Promise<void>`

### restore

Restores this box, if previously maximized.

```ts
() => Promise<void>
```

**Returns**: `Promise<void>`

### setSize

Sets a new size for the group

```ts
(sizeConfig: ElementResizeConfig) => Promise<void>
```

**Parameters**

- **`sizeConfig`** (`ElementResizeConfig`, required)
  A config object which should be the new size of the group.

**Returns**: `Promise<void>`

## Related types

- [BoxBuilder](https://docs.interop.io/desktop/reference/javascript/workspaces/boxbuilder/index.md)
- [BoxDefinition](https://docs.interop.io/desktop/reference/javascript/workspaces/boxdefinition/index.md)
- [Column](https://docs.interop.io/desktop/reference/javascript/workspaces/column/index.md)
- [ElementResizeConfig](https://docs.interop.io/desktop/reference/javascript/workspaces/elementresizeconfig/index.md)
- [Frame](https://docs.interop.io/desktop/reference/javascript/workspaces/frame/index.md)
- [GroupLockConfig](https://docs.interop.io/desktop/reference/javascript/workspaces/grouplockconfig/index.md)
- [Row](https://docs.interop.io/desktop/reference/javascript/workspaces/row/index.md)
- [Unsubscribe](https://docs.interop.io/desktop/reference/javascript/workspaces/unsubscribe/index.md)
- [Workspace](https://docs.interop.io/desktop/reference/javascript/workspaces/workspace/index.md)
- [WorkspaceBox](https://docs.interop.io/desktop/reference/javascript/workspaces/workspacebox/index.md)
- [WorkspaceElement](https://docs.interop.io/desktop/reference/javascript/workspaces/workspaceelement/index.md)
- [WorkspaceWindow](https://docs.interop.io/desktop/reference/javascript/workspaces/workspacewindow/index.md)
- [WorkspaceWindowDefinition](https://docs.interop.io/desktop/reference/javascript/workspaces/workspacewindowdefinition/index.md)
