i2 Notebook SDK
Search results for

    Show/hide table of contents

    Home > @i2analyze/notebook-sdk > commands > IActionArea > addDynamicGroup

    commands.IActionArea.addDynamicGroup() method

    Adds a dynamic group whose commands are created on demand each time the group is opened.

    Signature:

    addDynamicGroup<TCommandType extends CommandType = CommandType>(config: IDynamicGroupConfig<TCommandType>): void;
    

    Introduced: version 1.10

    Type Parameters

    Parameter Type Description
    TCommandType extends CommandType(default: CommandType) The type of the command-context for the group, which determines what payload is passed to onPopulate and what event API is passed to onSurface.

    Parameters

    Parameter Type Description
    config IDynamicGroupConfig<TCommandType> The configuration for the dynamic group, including the onPopulate callback.

    Returns:

    void

    Exceptions

    Error if config.id is not a valid GroupId.

    Remarks

    Unlike commands.IActionArea.addGroup(), the commands in a dynamic group are not created during plug-in initialization. Instead, the commands.IDynamicGroupConfigBase.onPopulate() callback is called each time the group is opened, allowing you to create commands that reflect the current application state.

    A dynamic group renders as a popup, never inline: by default a collapsed dropdown/submenu, or — when config.type is 'command' with a primaryCommand — a split button whose dropdown is populated on open.

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