Search
DashboardWidget Class
Remarks See Also
 






The base class for all dashboard widget components.

Namespace: MindFusion.Dashboards
File: DashboardWidget.js

 Syntax

JavaScript  Copy Code

// class
DashboardWidget.prototype = {}

 Remarks

DashboardWidget is the abstract base class for all visual components hosted within a dashboard. You cannot use it directly; instead, instantiate one of its specialized derived classes - such as KpiWidget, ChartWidget, GaugeWidget, GridWidget, CalendarWidget, ClockWidget, DiagramWidget, MapWidget, LabelWidget, or ImageWidget. You can also create bespoke widget types by subclassing DashboardWidget.

Every widget connects to the dashboard's data layer using the dataSource and dataPath properties:

  • dataSource: A string matching the unique identifier of a DataSource registered with the parent dashboard's DataSourceRegistry.
  • dataPath: A dot-delimited property path navigating to the specific object, array, or primitive within the data source payload.

The visual representation of a widget is created in the draw method, which returns an HTMLElement tree. When a widget's underlying data or properties change, calling invalidate schedules a UI repaint.

Widgets are wrapped inside a DashboardWidgetContainer by the layout engine. The container applies the card surface styles (background colors, borders, elevation shadows) defined by the active theme.

To enable live inspection in DashboardMode.Edit, widgets implement getMetadata. This method returns property metadata describing the widget's configurable fields, data types, and property grid categories.

Subclasses should override toJson and fromJson to serialize their custom properties alongside the standard widget attributes (id, cssClass, dataSource, dataPath).

 Inheritance Hierarchy

 See Also