Global Clock
In the top bar of every dashboard there is a clock icon that shows and controls a time interval. It is possible to connect the widget to this time interval to synchronize the data fetching.
Data Window
The global clock is itself a widget, you can see it Dashboard Tree expanding the root node. This widget has two properties:
- startDate: JavaScript Date object that represents the start of the time interval
- endDate: JavaScript Date object that represents the end of the time interval
Connect automatically a widget to global clock
BaseGraphicWgt
has the class method loadDefaultConfiguration
this method is called when the widget is added to the dashboard from the gallery or when the user drags a property from Device Slot Tree.
// This method is called every time a widget is dropped from gallery to the dashboard
public loadDefaultConfiguration(): void
{
// We load default to datalink to global DataWindow
const dataWindow = this.getProject().getWidget( "DataWindow" );
this.connectWidgetProperties(
dataWindow,
new Map( [
["from", { name: "startDate", permission: "read/write" } ],
["to", { name: "endDate", permission: "read/write" } ]
] )
);
}
BaseGraphicWgt
has the class method connectWidgetProperties
that permits to connect a widget property to a source widget.
You can use loadDefaultConfiguration
and connectWidgetProperties
to connect widget properties to all global widgets by default.