Skip to content

WidgetGridService

service

Service managing a widget grid. Also includes a set of labels that will be used by the grid and its widgets. Default labels are provided out of the box. But if you want to use custom ones or add i18n you could overwrite them. The grid as well as the widgets will use those labels or fall back to their default ones. If you are developing own widgets you should consider using those labels as well.

Type: AddItemSize

Default Value: \{ rows: 2, cols: 3 \}

Type: Observable<WidgetGridItem[]>

Default Value: this.#widgetGridSource.asObservable()

Type: Observable<string>

Default Value: this.#widgetGridUpdateSource.asObservable()

Emitted when the widget grid has been updated

Add a new grid item to the widget grid.

addWidget(widgetName: string, setupWidgetConfig?: unknown): void
NameTypeDescription
widgetNamestring
setupWidgetConfigunknown
removeWidget(gridItemId: string): void
NameTypeDescription
gridItemIdstring
replaceWidget(widgetId: string, widgetName: string, setupWidgetConfig?: unknown): void
NameTypeDescription
widgetIdstring
widgetNamestring
setupWidgetConfigunknown
setWidgetGrid(gridItemConfig: WidgetGridItemConfig[] | undefined): void
NameTypeDescription
gridItemConfigWidgetGridItemConfig[] | undefined

Update config of an existing widget

updateWidget(widgetId: string, setupWidgetConfig: unknown): void
NameTypeDescription
widgetIdstring
setupWidgetConfigunknown