Home > @i2analyze/notebook-sdk > commands > ICommandApi > createGroup
commands.ICommandApi.createGroup() method
Creates a detached group that you build once and surface into one or more areas with commands.IActionArea.surfaceGroup().
Signature:
createGroup<TCommandType extends CommandType = 'unscoped'>(group: IGroup<TCommandType>): IGroupTemplate;
Introduced: version 1.10
Type Parameters
| Parameter | Type | Description |
|---|---|---|
| TCommandType | extends CommandType(default: 'unscoped') | The type of the command-context for the group, which determines what event API is passed to its {@link commands.IGroupConfigBase.onSurface}. |
Parameters
| Parameter | Type | Description |
|---|---|---|
| group | IGroup<TCommandType> | The root group to create. |
Returns:
A detached group template that you can build on and surface.
Exceptions
Error if the group was not valid.
Remarks
The returned commands.IGroupTemplate exposes the same methods as an commands.IActionArea, so you build its contents — commands and nested groups — exactly as you would in place. Nothing is surfaced into the user interface until you pass the template to commands.IActionArea.surfaceGroup(), which you can do for several areas to avoid rebuilding the same group structure in each one.