Home > @i2analyze/notebook-sdk > commands > IDynamicGroupConfigBase > onPopulate
commands.IDynamicGroupConfigBase.onPopulate() method
Populates the group's commands each time the group is opened.
Signature:
onPopulate(commandArea: IDynamicActionArea, context: CommandPayloadMap[TCommandType], signal: AbortSignal): void | (() => void) | Promise<void | (() => void)>;
Introduced: version 1.10
Parameters
| Parameter | Type | Description |
|---|---|---|
| commandArea | IDynamicActionArea | A scoped area for creating and surfacing commands. Only commands created here are visible in this group. |
| context | CommandPayloadMap[TCommandType] |
The context based on the group's context field: undefined for 'unscoped', commands.IRecordsContext for 'records', the application object for 'application'.
|
| signal | AbortSignal | An AbortSignal that is aborted when the group closes. Use it to cancel any async work started in this callback. |
Returns:
void | (() => void) | Promise<void | (() => void)>
An optional cleanup function that is called when the group closes, before the signal is aborted. Async callbacks may resolve with the cleanup function or with undefined.
Remarks
May be synchronous or asynchronous. A synchronous callback creates and surfaces every command before it returns; the host then renders the populated group. An asynchronous callback returns a Promise that resolves once the contents are ready: the host opens the group immediately with skeleton placeholder rows in place of the real items, and swaps them in atomically when the promise resolves. If the group closes before the promise resolves the signal is aborted and any surfaced commands are discarded.