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: literal type

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?: any): void
NameTypeDescription
widgetNamestring
setupWidgetConfigany
removeWidget(gridItemId: string): void
NameTypeDescription
gridItemIdstring
replaceWidget(widgetId: string, widgetName: string, setupWidgetConfig?: any): void
NameTypeDescription
widgetIdstring
widgetNamestring
setupWidgetConfigany
setWidgetGrid(gridItemConfig: Array<WidgetGridItemConfig> | undefined): void
NameTypeDescription
gridItemConfigArray<WidgetGridItemConfig> | undefined

Update config of an existing widget

updateWidget(widgetId: string, setupWidgetConfig: any): void
NameTypeDescription
widgetIdstring
setupWidgetConfigany