Panel Service
Overview​
The Panel Service provides for activating/showing a panel that was registered
via the getPanelModule
extension method. Such panels can be either explicitly
activated or implicitly triggered to activate when some other event occurs.
Events​
The following events are published in PanelService
.
Event | Description |
---|---|
ACTIVATE__PANEL | Fires a ActivatePanelEvent when a particular panel should be activated (i.e. shown). |
API​
Panel Activation​
activatePanel
: Fires theACTIVATE_PANEL
event for a particular panel (id). An optionalforceActive
flag can be passed that whentrue
"forces" a panel to show. Ultimately, it is up to a panel's container whether it is appropriate to activate/show the panel. For instance, if the user opened and then closed a side panel that contains the panel to activate, that side panel may decide that the user knows best and will not open the panel (again).addActivatePanelTriggers
: Creates and returns event subscriptions that when fired will activate the specified panel with an optionalforceActive
flag (seeactivatePanel
). This allows for panel activation to be directly triggered by some other event(s). When the triggers are no longer needed, simply unsubscribe to the returned subscriptions. For example, a panel for tracking measurements might get activated every time theMeasurementService
fires aMEASUREMENT_ADDED
event like this:```js
panelService.addActivatePanelTriggers('measurement-tracking-panel-id', [
sourcePubSubService: measurementService,
sourceEvents: [
measurementService.EVENTS.MEASUREMENT_ADDED,
measurementService.EVENTS.RAW_MEASUREMENT_ADDED,
],
]);
```