MindSphere Web Components
Event View
The Event View displays a list of events reported in the current tenant or for a specific asset. The list is sortable and distributed over pages of a configurable size.
If no asset is specified, the Event View displays all events reported in the current tenant and adds a column for the related asset ID. When one or multiple events are selected, a selectedEventChanged
event is triggered.
Examples¶
Interface¶
Selector¶
1 | <mdsp-event-view></mdsp-event-view> |
Properties¶
Name | Type | Corresponding attribute | Default | Description | Allowed Values |
---|---|---|---|---|---|
assetId | string |
asset-id | Configures the asset whose events are displayed using its asset ID. If this property is not set, an additional 'Asset Id' column will be displayed and all events of the whole tenant are shown. |
||
columnSettingsVisible | boolean |
column-Settings-visible | false | Displays column settings button if true . |
|
context | string |
context | Configures the context of the component. See also here. | ||
dateRange | IDateRange |
Specifies the date range using from , to and isAllDay , refer to IDateRange model. |
|||
errorNotification | boolean |
error-notification | Enables error control if an error is thrown. This can be used for debug purposes. For productive use, the error event should be caught and handled in the application. See also here. |
||
filterable | boolean |
filterable | false | Enables filter options in the table if true . |
|
fromDate | Date |
Specifies the start date of the selected range. | |||
locale | string |
locale | Specifies the locale in which the component is displayed. The locales en and de are provided by default.See also here. |
||
localeManager | LocaleManager |
Returns a LocaleManager object. This can be used to add locales or to get the locale settings. See also here. |
|||
model | IDataModel |
Returns an object for data model handling. | |||
multiSelectable | boolean |
multi-selectable | false | Enables selection of multiple events at once if true . |
|
pagerMode | PagerMode |
pager-mode | Simple | Configures the table's pagination mode. | - Simple - Advanced - Hidden |
pageSize | number |
page-size | Configures the initial page size. | 1 - (pageSizeLimit of this component) | |
selectable | boolean |
selectable | false | Enables event selection if true . |
|
sort | string |
sort | Specifies the selected sorting of the data. Supports sorting by filterable fields of the Event Management Service. |
- source,asc - source,desc - timestamp,asc - timestamp,desc - severity,asc - severity,desc - acknowledged,asc - acknowledged,desc |
|
sortable | boolean |
sortable | true | Enables sortable options in the table if true . |
|
toDate | Date |
Specifies the end date of the selected range. | |||
typeId | string |
type-id | Configures the event type ID of which to display events. | ||
view | IViewModel |
Returns an object for view handling, refer to IViewModel model. |
Events¶
Name | Type | Description |
---|---|---|
selectedEventChanged | EventEmitter<any> |
Triggered when the selection of an event changes. |
selectedEventsChanged | EventEmitter<any[]> |
Triggered when the selection of multiple events changes. |
columnSettingsChanging | EventEmitter<ColumnSettingsChange> |
Triggered when the column settings are changing. columnSettings are provided here and can be modified by the developer at this point. |
connected | EventEmitter<any> |
Triggered after the component is created, initialized and appended to the DOM tree. |
error | EventEmitter<MdspUiError> |
Triggered when an error occurs in the component or while accessing APIs. See also here. |
Models¶
IBaseEvent
1 2 3 4 5 6 7 8 | interface IBaseEvent { id: string; typeId: string; correlationId: string; timestamp: string; entityId: string; etag: number; } |
IMindsphereStandardEvent
1 2 3 4 5 6 7 | interface IMindsphereStandardEvent extends IBaseEvent { severity: number; description: string; code: string; source: string; acknowledged: boolean; } |
IDataModel
1 2 3 4 | interface IDataModel { // forces reload of data, e.g. re-loading the events refresh(): void; } |
IViewModel
1 2 3 | interface IViewModel { refresh(): void; } |
Roles¶
mdsp:core:em.xxx
(Event Management API is used)
Snippets¶
Display Events of the Current Tenant¶
1 | <mdsp-event-view></mdsp-event-view> |
Display Events of a Specific Asset¶
The following sample configures the Event View to display all events for asset 1b100d51d9e444b49fd54dcefac1ef5a
.
1 | <mdsp-event-view></mdsp-event-view> |
1 2 | const eventViewComp = document.querySelector('mdsp-event-view'); eventViewComp.assetId = '1b100d51d93444b49fd54dcefac1ef5a'; |
Use Simple Paging¶
1 | <mdsp-event-view pager-mode="Simple"></mdsp-event-view> |
Use Advanced Paging¶
1 | <mdsp-event-view pager-mode="Advanced"></mdsp-event-view> |
Refresh the Event View¶
The data model of the Event View can be refreshed to get the latest events, for example to update the view cyclically.
1 | eventViewComp.model.refresh(); |
Display Events of a specific type and their properties in extra columns¶
1 2 3 | // taken the typeId from the eventtypes api eventViewComp.typeId = "5d480a00-5c45-4e81-bb8f-6ab6597aa32e"; // after that only events of this type will be shown in the table, for each property a column will be shown |
Enable filters in the column header¶
1 | <mdsp-event-view filterable="true"></mdsp-event-view> |
The filter buttons are shown if the field is marked as filterable
in the related event type definition.
Enable a settings menu for the visible columns¶
1 | <mdsp-event-view column-settings-visible="true"></mdsp-event-view> |
With this menu, the visible columns can be set. If the settings needs to be saved for the future, the event columnSettingsChanging
should be used to read and set the columnSettings
.
Any questions left?
Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.