In addition to creating a widget using widget generation wizard, you can implement your own custom widgets and use them within the Dashboard portal.
Tip |
---|
If you want to refer the configurations source of a sample widget to develop your custom widget, you can find them the available sample widgets here. |
This section explains:
- How to write a custom widget for the Dashboard portal
- The features that are provided for widget developers in the Dashboard portal
...
- Access the data provider configurations in
<SP_HOME>/deploment/web-ui-apps/portal/extensions/widgets/<WIDGET_NAME>/widgetConf.json
file as specified in Accessing Widget Configuration. - Use the base widget API to create the WebSocket connection. For this, you can use the following APIs:
Subscribe to the endpoint
API Syntax super.getWidgetChannelManager( ).subscribeWidget(<Widget id>, <Call back method to handle data>, <data provider configs>)
Example super.getWidgetChannelManager()
.subscribeWidget(this.props.id , this.handleDataReceived , dataProviderConfigs));
Unsubscribe from the endpoint
API Syntax super. getWidgetChannelManager(). unsubscribeWidget(<Widget ID>);
Example super.getWidgetChannelManager().unsubscribeWidget(this.props.id);