Skip to content

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

Event-View

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.
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.
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
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.
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>

Simple paging

Use Advanced Paging

1
<mdsp-event-view pager-mode="Advanced"></mdsp-event-view>

Advanced paging

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

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

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.