replaceSectionItem()
Home > @gooddata/sdk-ui-dashboard > replaceSectionItem
replaceSectionItem() function
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Creates the ReplaceSectionItem command. Dispatching this command will result in replacement of particular dashboard item with a new item. By default, the old item will be discarded, however you may specify to stash it for later use.
Signature:
export declare function replaceSectionItem(sectionIndex: number, itemIndex: number, item: DashboardItemDefinition, stashIdentifier?: StashedDashboardItemsId, autoResolveDateFilterDataset?: boolean, correlationId?: string): IReplaceSectionItem;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
sectionIndex |
number |
index of section where the item to replace resides |
|
itemIndex |
number |
index of item within the section |
|
item |
new item definition | |
|
stashIdentifier |
(Optional) specify identifier of stash where the old item should be stored | |
|
autoResolveDateFilterDataset |
boolean |
(Optional) specify whether dashboard should auto-resolve date dataset to use for date filtering of KPI or insight widget that is replacing the existing item; default is disabled meaning date filtering will be enabled only for those KPI or Insight widgets that already specify dateDataset. |
|
correlationId |
string |
(Optional) specify correlation id to use for this command. this will be included in all events that will be emitted during the command processing TODO LX-648: Consider removing this command variant and leave only a nested variant |
Returns:
Remarks
This command operates only on the root layout. For nested layouts, use replaceNestedLayoutSectionItem().