Home > @i2analyze/notebook-sdk > commands > IGroupConfigBase > onSurface
commands.IGroupConfigBase.onSurface() method
Runs when an action derived from the group is surfaced, enabling the group to configure the action in response to events.
Signature:
onSurface?(groupAction: IGroupAction, eventApi: CommandEventsMap[TCommandType], signal: AbortSignal): void | (() => void);
Introduced: version 1.10
Parameters
| Parameter | Type | Description |
|---|---|---|
| groupAction | IGroupAction | The group action being surfaced. |
| eventApi | CommandEventsMap[TCommandType] |
The events that the group can subscribe to, keyed by the group's context.
|
| signal | AbortSignal | A signal that the application uses to tell the group that it is removing it from the user interface. |
Returns:
void | (() => void)
A function that the application calls when it removes the group from the user interface. In its implementation, the group must unsubscribe from any events that it has subscribed to.
Remarks
Mirrors commands.ICommandConfig.onSurface() but applies to groups: use the supplied commands.IGroupAction to change the group's label, icon, or enabled/hidden state at any time during its surfaced lifetime. The signal aborts when the group is removed from the user interface; the optional returned cleanup function runs at the same time.
If there is no implementation of onSurface(), the group renders with its static configuration and remains enabled.