i2 Notebook SDK
Search results for

    Show/hide table of contents

    Home > @i2analyze/notebook-sdk > commands > IDynamicGroupConfigBase > onSurface

    commands.IDynamicGroupConfigBase.onSurface() method

    Runs when the dynamic group's popup button is surfaced, enabling its state to be driven from 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 the popup button from the user interface.

    Returns:

    void | (() => void)

    A function that the application calls when it removes the popup button from the user interface. In its implementation, the group must unsubscribe from any events that it has subscribed to.

    Remarks

    The lifetime of this callback is the dynamic group's button — separate from the per-open lifecycle of commands.IDynamicGroupConfigBase.onPopulate(), which populates the popup's contents. Use this callback to react to long-lived application state; populate the popup's contents in onPopulate.

    If there is no implementation of onSurface(), the popup button renders with its static configuration and remains enabled.

    In this article
    Back to top © N. Harris Computer Corporation