Search
Dashboard Class
Remarks See Also
 






Represents the data model for a dashboard, containing the collection of widgets.

Namespace: MindFusion.Dashboards
File: Dashboard.js

 Syntax

JavaScript  Copy Code

// class
Dashboard.prototype = {}

 Remarks

The Dashboard class represents the document data model of a dashboard. It maintains the collection of active widgets, manages data retrieval through its DataSourceRegistry, coordinates widget template registrations via WidgetRegistry, and handles data-level serialization.

Widgets are added to the model by calling the addWidget method. When working with the default GridLayout, addWidget accepts the target widget along with its column, row, columnSpan, and rowSpan coordinates:

JavaScript  Copy Code

dashboard.addWidget(kpiWidget, 0, 0, 1, 1);


To remove a widget, call removeWidget, or wipe the entire dashboard clean by calling clearAll.

Data sources used by widgets are managed through the dataSources property, which returns the dashboard's DataSourceRegistry. When a registered DataSource refreshes, the Dashboard automatically notifies any widgets bound to that source's identifier, triggering targeted UI updates without requiring a full page reload.

The Dashboard class exposes several event dispatchers for monitoring lifecycle changes:

  • widgetAdded: Raised when a new widget is inserted into the collection.
  • widgetRemoved: Raised when a widget is detached from the dashboard.
  • widgetUpdated: Raised when a widget's property values or layout bounds change.
  • widgetClicked: Raised when a user clicks on a widget card.
  • registryChanged: Raised when widget templates in the WidgetRegistry are updated.

 Inheritance Hierarchy

MindFusion.Dashboards.Dashboard

 See Also